Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 197948 - net-misc/zebedee-2.5.3 - '/etc/init/zebedee stop' does not set the "stopped" state
Summary: net-misc/zebedee-2.5.3 - '/etc/init/zebedee stop' does not set the "stopped" ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Jeremy Olexa (darkside) (RETIRED)
URL: http://gentoo-portage.com/net-misc/ze...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-03 12:21 UTC by WayneSherman
Modified: 2008-06-14 03:36 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description WayneSherman 2007-11-03 12:21:07 UTC
net-misc/zebedee-2.5.3
Executing '/etc/init/zebedee stop' does stop zebedee, but does not set it's state to stopped.  Therefore trying to start it fails with:
  " * WARNING:  zebedee has already been started."
As a work around, after it is stopped you can execute '/etc/init/zebedee zap'.  This manually resets the state so it may be started again.



 running it again appears to be successful, cannot start it since it 

Reproducible: Always

Steps to Reproduce:
with net-misc/zebedee-2.5.3 zebedee installed, execute the following:
1. /etc/init/zebedee start
 * Starting Zebedee ... 
2. /etc/init.d/zebedee stop
 * Stopping Zebedee ...
3. /etc/init/zebedee start
 * WARNING:  zebedee has already been started.

Actual Results:  
Zebedee does not start after stopping it with /etc/init.d/zebedee stop

Expected Results:  
Zebedee should start

Work around is to call /etc/init.d/zebedee zap after stopping it:

 /etc/init.d/zebedee zap
 * Manually resetting zebedee to stopped state.
Comment 1 WayneSherman 2007-11-04 17:01:14 UTC
I don't know the finer points of the Gentoo init.d system architecture, but here is a possible fix.  The current stop function in "/etc/init.d/zebedee" looks like this:

stop() {
	ebegin "Stopping Zebedee"
	start-stop-daemon --quiet --stop --pidfile /var/run/zebedee.pid
	eend $? "Failed to stop Zebedee"

	# clean stale pidfile
	[ -f /var/run/zebedee.pid ] && rm -f /var/run/zebedee.pid
}

I compared this to other init.d files and noticed they don't "clean stale pidfile" in their stop functions.  Commenting this line out seems to restore proper function.

So the corrected function is:

stop() {
	ebegin "Stopping Zebedee"
	start-stop-daemon --quiet --stop --pidfile /var/run/zebedee.pid
	eend $? "Failed to stop Zebedee"
}
Comment 2 WayneSherman 2007-11-04 17:06:06 UTC
Also, the other init.d files don't have a "Failed to stop..." message in them either.  Perhaps this is the way it should be done:

stop() {
        ebegin "Stopping Zebedee"
        start-stop-daemon --quiet --stop --pidfile /var/run/zebedee.pid
        eend $?
}
Comment 3 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-06-14 03:35:58 UTC
Looks good, fixed.

For future reference: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=4#doc_chap4

=)