Allow non-sudo group to control Upstart job
Posted
by
Angle O'Saxon
on Ask Ubuntu
See other posts from Ask Ubuntu
or by Angle O'Saxon
Published on 2012-12-17T04:02:49Z
Indexed on
2012/12/17
5:13 UTC
Read the original article
Hit count: 229
I'm trying to set up an Upstart job to run on system startup, and that can also be started/stopped by members of a group other than sudo
. With a previous version, I usedupdate-rc.d
and scripts stored in /etc/init.d/
to get this working by adding %Group ALL = NOPASSWD: /etc/init.d/scriptname
to my sudoers file, but I can't seem to get an equivalent working for Upstart.
I tried adding %Group ALL = NOPASSWD: /sbin/initctl start jobname
to the sudoers file, but trying to run the command start jobname
produces this error:
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.21" (uid=1000 pid=5148 comm="start jobname " 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")
As near as I can tell, that's a complaint about how my user account isn't given the power to send 'Start' messages in the D-Bus config file for Upstart. I haven't been able to actually find any information on how to edit that file to give a group permission to access a specific service--does such an option exist? Is there a way to edit the Sudoers file so I can run the job without editing the config file? Am I better off just sticking with the previous version?
© Ask Ubuntu or respective owner