From 9ce54add64f98877dbfe9ff9f4d725077bc67f4b Mon Sep 17 00:00:00 2001 From: jvdias Date: Wed, 22 Sep 2004 14:55:33 +0000 Subject: [PATCH] do restorecon on newly created dhcpd.leases --- dhcpd.init | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/dhcpd.init b/dhcpd.init index 2770a20..d53e542 100644 --- a/dhcpd.init +++ b/dhcpd.init @@ -18,24 +18,17 @@ [ -f /usr/sbin/dhcpd ] || exit 0 [ -f /etc/dhcpd.conf ] || exit 0 -[ -f /var/lib/dhcp/dhcpd.leases ] || touch /var/lib/dhcp/dhcpd.leases - +if [ ! -f /var/lib/dhcp/dhcpd.leases ] ; then + touch /var/lib/dhcp/dhcpd.leases + [ -x /sbin/restorecon ] && [ -d /selinux ] && /sbin/restorecon /var/lib/dhcp/dhcpd.leases +fi RETVAL=0 prog="dhcpd" configtest() { - local retval TEMP=/tmp/dhcpd$$.err - - /usr/sbin/dhcpd -t 2>$TEMP - retval=$? - if [ $retval -ne 0 ] - then - cat $TEMP - rm -f $TEMP - fi - - return $retval + /usr/sbin/dhcpd -t + return $? } start() {