1

I'm trying to allow non-privileged users to run upstart jobs from their $HOME/.init directory.

Upstart cookbook mentions that you must enable this, but doesn't mention how to do it. The frustration can be summarised by @ropez's comment:

the documentation doesn't seem to mention how to enable user jobs, it only mentions the config file, and that the administrator must do it

I'm still getting this error when I try to start a job as a non-privileged user:

start: Rejected send message, 1 matched rules; type="method_call", sender=":1.70"

The closest I found so far is a gist of someone's patched Upstart.conf, but it seems a lot shorter than the one I see in Ubuntu 12.04 that I'm using.

Is there a canonical, well-defined way of doing this?

P.S. I am aware of related questions. However, none of their answers actually show how to do it.

1

The "patched" Upstart configuration you link to is the same as the Upstart configuration that was shipped with Upstart 1.3 (from cannot get upstart to run user job), so I'd say that is the simplest way to enable user jobs.

  • Ubuntu 12.04 ships with Upstart 1.5 by default, and the config seems to be different (without user jobs enabled). – gregoltsov Nov 28 '14 at 15:08
0

This solution works for Upstart 1.5 on Ubuntu 12.04.

Open the upstart config:

sudo vim /etc/dbus-1/system.d/Upstart.conf

Comment out the default policy, i.e.

<policy context="default">
    ...
</policy>

and paste the block from this patch:

<!--
Allow any user to invoke all of the methods on Upstart, its jobs
or their instances, and to get and set properties - since Upstart
isolates commands by user.
 -->
<policy context="default">
    <allow send_destination="com.ubuntu.Upstart"
        send_interface="org.freedesktop.DBus.Introspectable" />
    <allow send_destination="com.ubuntu.Upstart"
        send_interface="org.freedesktop.DBus.Properties" />
    <allow send_destination="com.ubuntu.Upstart"
        send_interface="com.ubuntu.Upstart0_6" />
    <allow send_destination="com.ubuntu.Upstart"
        send_interface="com.ubuntu.Upstart0_6.Job" />
    <allow send_destination="com.ubuntu.Upstart"
        send_interface="com.ubuntu.Upstart0_6.Instance" />
</policy>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.