# HG changeset patch # User Vladimir Marek # Date 1466400273 -7200 # Node ID 352cbf24c3f972566381275f947b6ed2bb9764b9 # Parent 926a85aa8bf5ae31219fd7b9498aa941465a9934 23614944 ISC should be helpful in case of unwritable lease file diff -r 926a85aa8bf5 -r 352cbf24c3f9 components/isc-dhcp/Solaris/isc-dhcp.sh --- a/components/isc-dhcp/Solaris/isc-dhcp.sh Mon Jun 20 23:53:43 2016 -0700 +++ b/components/isc-dhcp/Solaris/isc-dhcp.sh Mon Jun 20 07:24:33 2016 +0200 @@ -29,7 +29,9 @@ SVCPROP=/usr/bin/svcprop CHMOD=/usr/bin/chmod +CHOWN=/usr/bin/chown TOUCH=/usr/bin/touch +ID=/usr/bin/id DHCPD_IPV4="svc:/network/dhcp/server:ipv4" DHCPD_IPV6="svc:/network/dhcp/server:ipv6" @@ -148,9 +150,17 @@ errlog "No lease_file specified, exiting" return 1 fi + + LEASEFILE_PERMS="u=rw,go=r" if [ ! -f "$LEASEFILE" ]; then $TOUCH $LEASEFILE - $CHMOD u=rw,go=r $LEASEFILE + $CHMOD $LEASEFILE_PERMS $LEASEFILE + fi + if [ ! -w "$LEASEFILE" ]; then + errlog "Lease file '$LEASEFILE' is not writable. You should:" + errlog "$CHOWN $($ID -u -n) '$LEASEFILE'" + errlog "$CHMOD $LEASEFILE_PERMS '$LEASEFILE'" + return 1 fi export OPTIONS="$OPTIONS -cf $CONFIGFILE -lf $LEASEFILE $LISTENIFNAMES"