Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 201749 - sys-process/daemontools-0.76-r5 - /etc/init.d/svscan stops supervise and svscan in the wrong order
Summary: sys-process/daemontools-0.76-r5 - /etc/init.d/svscan stops supervise and svsc...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-09 09:28 UTC by Tavin Cole
Modified: 2008-04-06 16:53 UTC (History)
0 users

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 Tavin Cole 2007-12-09 09:28:48 UTC
the following stop() function is run by /etc/init.d/svscan:

stop() {
        ebegin "Stopping service scan services"
        svc -dx /service/* 2>/dev/null
        eend $?
        ebegin "Stopping service scan logging"
        svc -dx /service/*/log 2>/dev/null
        eend $?
        ebegin "Stopping service scan"
        start-stop-daemon --stop --exec /usr/bin/svscan \
                --pidfile /var/run/svscan.pid
        eend $?
}

in between the time the supervise processes are killed by svc -dx, and the time the svscan process is killed, svscan may spawn new supervise processes, since that's what it's supposed to do every 5 seconds.  so you can potentially wind up with a lot of unkilled daemons at shutdown time.

the fix is simple, just kill svscan first:

stop() {
        ebegin "Stopping service scan"
        start-stop-daemon --stop --exec /usr/bin/svscan \
                --pidfile /var/run/svscan.pid
        eend $?
        ebegin "Stopping service scan services"
        svc -dx /service/* 2>/dev/null
        eend $?
        ebegin "Stopping service scan logging"
        svc -dx /service/*/log 2>/dev/null
        eend $?
}
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-12-09 09:37:07 UTC
No idea what installs /etc/init.d/svscan; reopen with exact ebuild name and version.
Comment 2 Tavin Cole 2007-12-09 09:47:44 UTC
sys-process/daemontools-0.76-r5
Comment 3 Benedikt Böhm (RETIRED) gentoo-dev 2008-04-06 16:53:17 UTC
fixed in 0.76-r6