|
Bugzilla – Full Text Bug Listing |
| Summary: | network:dhcp: Init script "rc.dhcpd" not fully LSB compliant | ||
|---|---|---|---|
| Product: | [openSUSE] openSUSE 11.3 | Reporter: | Forgotten User xRcrmyYBVX <forgotten_xRcrmyYBVX> |
| Component: | Other | Assignee: | Marius Tomaschewski <mt> |
| Status: | RESOLVED FIXED | QA Contact: | E-mail List <opensuse-communityscreening> |
| Severity: | Normal | ||
| Priority: | P5 - None | CC: | lnussel, maintenance, manfred.danzer, radmanic, werner |
| Version: | Final | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | SLES 11 | ||
| Whiteboard: | . | ||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Deadline: | 2011-05-16 | ||
| Attachments: | Proposed patch with more exact return codes | ||
Possible patch: --- rc.dhcpd +++ rc.dhcpd @@ -95,15 +95,17 @@ # with force-reload (in case signalling is not supported) are # considered a success. -if ! [ -x "$DAEMON_BIN" ]; then - if [ "$1" = "stop" ]; then exit 0; fi - echo >&2 "$0: \"$DAEMON_BIN\" is not an executable file. Exiting." - exit 5 -fi -if ! [ -r "$DAEMON_CONF" ] ; then - if [ "$1" = "stop" ]; then exit 0; fi - echo >&2 "$0: \"$DAEMON_CONF\" config file missed. Exiting." - exit 6 +if ! [ "$1" = "status" ]; then + if ! [ -x "$DAEMON_BIN" ]; then + if [ "$1" = "stop" ]; then exit 0; fi + echo >&2 "$0: \"$DAEMON_BIN\" is not an executable file. Exiting." + exit 5 + fi + if ! [ -r "$DAEMON_CONF" ] ; then + if [ "$1" = "stop" ]; then exit 0; fi + echo >&2 "$0: \"$DAEMON_CONF\" config file missed. Exiting." + exit 6 + fi fi # remove empty pid files to avoid disturbing warnings by checkproc/killproc OK, the codes 5 and 6 are reserved by LSB in status and the dhcpd binary started by the service before may, still run. When a service gets uninstalled, the service is stopped and the binary _and_ the init script removed via rpm scripts. The easiest (only?) way to trigger the problem is to just remove the config file without to stop/uninstall the service. Question is, if this is a bug -- that exists in any service / init script we ship as well as in /etc/init.d/skeleton, or it has to be resolved as INVALID [WONTFIX] because it is incorrect use similar to e.g. a "chmod -x $binary" ? RĂ¼diger, Werner, what do you say? Interesting case. Looks like a misbehavior of the scripts, even though the state of server running but config absent is weird. Whether the service is running or not is finally irrelevant. As soon as the config file is removed, wrong status codes are returned. Created attachment 392102 [details] Proposed patch with more exact return codes I'd prefer this patch instead of one in comment 1. In case there is no executable binary: stop -> code 0 (success) the service may still run, but we can't stop it using killproc. => use rpm -e or similar to deinstall properly "chmod -x $binary" or "mv $binary ..." => unsupported case. status -> code 4 (service status unknown) the service may still run, but we can't stop find it using checkproc. checkproc would return code 5 here => IMO a bug * -> code 5 (program is not installed) In case of missed dhcpd.conf: stop -> killproc return code check for chroot pid file when /etc/sysconfig/dhcpd is missed too status -> checkproc return code check for chroot pid file when /etc/sysconfig/dhcpd is missed too * -> code 6 (program is not configured) Comments? timeout ;-) Actually, I just tested your patch today on our HA cluster. Works nicely! :-) (In reply to comment #9) > Actually, I just tested your patch today on our HA cluster. Works nicely! :-) Thanks! I'm going to prepare fixed package in my collection/branch first [there are also another reports for the dhcp package I've to review]: http://download.opensuse.org/repositories/home:/mtomaschewski:/branches:/openSUSE:/11.3:/Update:/Test/ and finally request a submit into :Update:Test. The SWAMPID for this issue is 40346. This issue was rated as low. Please submit fixed packages until 2011-05-16. Also create a patchinfo file using this link: https://swamp.suse.de/webswamp/wf/40346 Fixed SLE-11-SP1 dhcp-3.x package (request were 11595) and patchinfo for SWAMPID 40346 is submitted. The dhcp-4.x packages on openSUSE-11.3 and 11.4 already this fix before. Update released for: dhcp, dhcp-client, dhcp-debuginfo, dhcp-debugsource, dhcp-devel, dhcp-relay, dhcp-server Products: SLE-DEBUGINFO 11-SP1 (i386, ia64, ppc64, s390x, x86_64) SLE-DESKTOP 11-SP1 (i386, x86_64) SLE-SDK 11-SP1 (i386, ia64, ppc64, s390x, x86_64) SLE-SERVER 11-SP1 (i386, ia64, ppc64, s390x, x86_64) SLES4VMWARE 11-SP1 (i386, x86_64) |
The init script "rc.dhcpd" is not fully LSB compliant. When the executable of configuration file of the dhcp server is not found in the beginning of the init script, it returns exit 5 or 6 respectively, which is not valid if the "status" parameter was given. The problem arises in a Heartbeat/Linux-HA configuration, where the Heartbeat service runs a ressource monitor using "rcdhcpd status" to check the status of this ressource. If the configuration file is not available at the time this command is run (e.g. when the configuration file is on an DRBD device which is not (yet) mounted), then the exit code of "6" will cause the Heartbeat monitor to fail, as this exit code is not expected from the "status" parameter! Here are the corresponding lines (98 to 107) in "rc.dhcpd": if ! [ -x "$DAEMON_BIN" ]; then if [ "$1" = "stop" ]; then exit 0; fi echo >&2 "$0: \"$DAEMON_BIN\" is not an executable file. Exiting." exit 5 fi if ! [ -r "$DAEMON_CONF" ] ; then if [ "$1" = "stop" ]; then exit 0; fi echo >&2 "$0: \"$DAEMON_CONF\" config file missed. Exiting." exit 6 fi