Sudo. How to give permissions to restart daemon?

I want to give a particular user the permission to restart /usr/local/sbin/rinetd daemon.
I know two possibilities to restart this daemon
Code:
/usr/local/etc/rc.d/rinetd restart
or
Code:
kill -1 `cat /var/run/rinetd.pid`
The following way is not supported by /usr/local/sbin/rinetd
Code:
/usr/local/sbin/rinetd restart
How to give the permission to user without giving access to whole /bin/kill command?
 
Besides running the scripts in /usr/local/etc/rc.d there's also the service(8) command. It's easier to remember. To allow a user to restart it you'll need a line like this:
Code:
dice ALL=(ALL) NOPASSWD: service rinetd restart

You don't have to allow a single command, it can be a complete command including parameters.
 
SirDice said:
Besides running the scripts in /usr/local/etc/rc.d there's also the service(8) command. It's easier to remember. To allow a user to restart it you'll need a line like this:
Code:
dice ALL=(ALL) NOPASSWD: service rinetd restart

You don't have to allow a single command, it can be a complete command including parameters.
Thanks. It did the trick.

mrjayviper said:
Where do I put that SirDice? Thanks
In /usr/local/etc/sudoers.
 
Back
Top