Reload config files automatically as non root
Siobhan Keehan
siobhan.keehan at ericsson.com
Wed Nov 16 14:16:33 UTC 2011
Hi Glen,
Thanks for that. A cron was what I was thinking of, but I was curious if there was something like the rescan interval in SUN DHCP
//Siobhan
-----Original Message-----
From: dhcp-users-bounces+siobhan.keehan=ericsson.com at lists.isc.org [mailto:dhcp-users-bounces+siobhan.keehan=ericsson.com at lists.isc.org] On Behalf Of Glenn Satchell
Sent: 16 November 2011 14:12
To: Users of ISC DHCP
Subject: Re: Reload config files automatically as non root
On 11/17/11 00:14, Siobhan Keehan wrote:
> Hi,
> I have a user that can add hosts and networks to dhcp, but as they are
> not root do not have the permissions to restart the dhcpd.
> Is there any way of configuring dhcpd to allow it to reread the config
> files automatically for example every minute Thanks
>
You could have a script run from cron every minute. In the script check the modification time of the dhcpd.conf file, plus any included files.
If changed since the previous check then do a syntax check (dhcpd -t) and if that is ok restart dhcpd.
When you restart dhcpd, touch a reference file in /tmp. Next time you run, check if the dhcpd.conf is newer than the reference file, if it is, then it must have been updated and dhcpd should be restarted
Something like this:
if [ -f /tmp/ref ]; then
if [ /etc/dhcpd.conf -nt /tmp/ref ]; then
touch /tmp/ref
/etc/init.d/dhcpd restart
fi
else
touch /tmp/ref
fi
--
regards,
-glenn
_______________________________________________
dhcp-users mailing list
dhcp-users at lists.isc.org
https://lists.isc.org/mailman/listinfo/dhcp-users
More information about the dhcp-users
mailing list