[sudo-users] sudo and variable expantion: HowTo?
Matthew Hannigan
mlh at zip.com.au
Thu Jun 8 19:28:01 EDT 2006
On Thu, Jun 08, 2006 at 02:09:03PM -0400, Todd C. Miller wrote:
> In message <20060608135635.GB26755 at evofed.localdomain>
> so spake Matthew Hannigan (mlh):
>
> > Best off writing a wrapper script, say, hupntp, with
> > contents
> > #!/bin/sh
> > /bin/kill -HUP `cat /var/run/ntpd.pid`
> >
> > then in sudoers:
> >
> > mortal ALL = /usr/local/bin/hupntp
>
> Another option is to use something like pkill or killall (depending
> on the OS) instead to kill a process by name instead of using a pid
> file.
Indeed, in fact many platforms have a standard way of doing
the above for all system daemons;
redhat/fedora:
service ntpd restart
solaris10:
svcadm restart network/ntpd
many others:
/etc/init.d/ntpd restart
or
/etc/init.d/ntpd stop
/etc/init.d/ntpd start
Matt
More information about the sudo-users
mailing list