Mantis - dhcp
Viewing Issue Advanced Details
4064 packaging feature N/A 2009-12-03 13:29 2010-02-16 10:02
skayser  
bonivart  
normal  
closed  
fixed  
none    
none  
0004064: RFE: Extend init script with a "restart" option
To have dhcpd reload its configuration i currently do

    /etc/opt/csw/init.d/cswdhcpd stop
    /etc/opt/csw/init.d/cswdhcpd start

Could we get a

    /etc/opt/csw/init.d/cswdhcpd restart

instead? Possibly with configuration file syntax checking before the stop so that the service is only stopped when the configuration file is sane. Something like httpd -S (in case dhcpd offers it).
# pkgparam CSWdhcp VERSION
4.1.1b2,REV=2009.08.13
Issue History
2009-12-03 13:29 skayser New Issue
2009-12-03 13:38 bonivart Status new => assigned
2009-12-03 13:38 bonivart Assigned To => bonivart
2009-12-03 13:53 bonivart Note Added: 0007061
2009-12-07 16:52 bonivart Note Added: 0007070
2009-12-10 19:44 skayser Note Added: 0007080
2009-12-10 23:45 bonivart Note Added: 0007082
2009-12-11 17:47 bonivart Note Added: 0007085
2010-01-19 11:19 bonivart Note Added: 0007293
2010-02-16 10:02 bonivart Note Added: 0007444
2010-02-16 10:02 bonivart Status assigned => closed
2010-02-16 10:02 bonivart Resolution open => fixed

Notes
(0007061)
bonivart   
2009-12-03 13:53   
Sure, I can fix that as soon as the farm is online again.
(0007070)
bonivart   
2009-12-07 16:52   
I have put beta 3 packages in testing now. The init script has an added restart option that tries to look at both the configuration and the lease file before stopping the running server.

This is totally untested though so maybe you could test it and get back to me? I will fix/add any problems/features.
(0007080)
skayser   
2009-12-10 19:44   
FAIL needs some quotes to prevent a syntax error.

diff cswdhcpd.org cswdhcpd
36,38c36,38
< [ $FAIL = 1 ] && echo "Your configuration seems broken. Exiting."
< [ $FAIL = 2 ] && echo "Your lease file seems broken. Exiting."
< [ $FAIL ] && exit 1
---
> [ "$FAIL" = 1 ] && echo "Your configuration seems broken. Not restarting."
> [ "$FAIL" = 2 ] && echo "Your lease file seems broken. Not restarting."
> [ "$FAIL" ] && exit 1

Also, I just noticed funny things with SMF on Solaris 10. Even if there is a restart option, SMF only seems to trigger stop and start.

# svcadm restart cswdhcp
# /var/svc/log/network-cswdhcpd\:default.log
...
[ Dec 10 19:39:59 Stopping because service restarting. ]
[ Dec 10 19:39:59 Executing stop method ("/var/opt/csw/svc/method/svc-cswdhcpd stop") ]
Stopping dhcp.
[ Dec 10 19:39:59 Method "stop" exited with status 0 ]
[ Dec 10 19:39:59 Executing start method ("/var/opt/csw/svc/method/svc-cswdhcpd start") ]
Starting dhcp.
...
(0007082)
bonivart   
2009-12-10 23:45   
Thanks for fixing the script.

Regarding the SMF restart, I have to take a look at it. You should have gotten the line with "waiting for dhcp to stop".

I'll see if I get some time tomorrow. I'll update to RC1 which they released the other day, hopefully we will get a final release in a few weeks.
(0007085)
bonivart   
2009-12-11 17:47   
4.1.1rc1,REV=2009.12.11 in testing with your changes to the init script. Still untested by me. Sorry about that.

Fortunately ISC haven't done a thing between beta 3 and release candidate 1 so we can probably expect a final release real soon.
(0007293)
bonivart   
2010-01-19 11:19   
4.1.1 has been released. Packages in testing.
(0007444)
bonivart   
2010-02-16 10:02   
4.1.1 released.