Running 12.04, I have the following upstart job in ~/.init/
:
# myjob
start on net-device-up
stop on [!12345]
script
echo ">> hello from user script" >> ~/tmp/upstart.log
end script
After rebooting my machine
service myjob start
# => myjob: unrecognised service
initctl
does list the job, but running it without sudo throws an error:
initctl start myjob
# => initctl: Rejected send message, 1 matched rules; type="method_call", sender=":1.100" (uid=1000 pid=13349 comm="initctl start thunderbird ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
I would expect to be able to start the job using service
or initctl
without using sudo
. What have I misunderstood?
Thanks