I want to create a situation where something unprivileged user does (via SSH) triggers an event that causes an upstart job do perform some action. The activities rely on filesystem changes, so I welcome alternative methods.
Basically I want to have something like:
description "Foo job" exec foo start on foo
and then have the user trigger the event like foo. When I say "user", I actually mean a git hook script that is run automatically when git pushes to a repository on the host via SSH.
I've tried simply running
initctl emit foo, but that only works when I do so as root.
I also cannot use user jobs for this particular case, because I want the job in question to restart servers and create directory structures where user emitting the event has no access.
Any ideas on how I could accomplish this without giving user unnecessary privileges?
EDIT: Just to add a requirement I forgot to mention. This has to be scriptable, so entering passwords is not an option.