<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>201749</bug_id>
          
          <creation_ts>2007-12-09 09:28 0000</creation_ts>
          <short_desc>sys-process/daemontools-0.76-r5 - /etc/init.d/svscan stops supervise and svscan in the wrong order</short_desc>
          <delta_ts>2008-04-06 16:53:17 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Ebuilds</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>tavin.cole@gmail.com</reporter>
          <assigned_to>base-system@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>tavin.cole@gmail.com</who>
            <bug_when>2007-12-09 09:28:48 0000</bug_when>
            <thetext>the following stop() function is run by /etc/init.d/svscan:

stop() {
        ebegin &quot;Stopping service scan services&quot;
        svc -dx /service/* 2&gt;/dev/null
        eend $?
        ebegin &quot;Stopping service scan logging&quot;
        svc -dx /service/*/log 2&gt;/dev/null
        eend $?
        ebegin &quot;Stopping service scan&quot;
        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&apos;s what it&apos;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 &quot;Stopping service scan&quot;
        start-stop-daemon --stop --exec /usr/bin/svscan \
                --pidfile /var/run/svscan.pid
        eend $?
        ebegin &quot;Stopping service scan services&quot;
        svc -dx /service/* 2&gt;/dev/null
        eend $?
        ebegin &quot;Stopping service scan logging&quot;
        svc -dx /service/*/log 2&gt;/dev/null
        eend $?
}</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2007-12-09 09:37:07 0000</bug_when>
            <thetext>No idea what installs /etc/init.d/svscan; reopen with exact ebuild name and version.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>tavin.cole@gmail.com</who>
            <bug_when>2007-12-09 09:47:44 0000</bug_when>
            <thetext>sys-process/daemontools-0.76-r5</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hollow@gentoo.org</who>
            <bug_when>2008-04-06 16:53:17 0000</bug_when>
            <thetext>fixed in 0.76-r6</thetext>
          </long_desc>
      
    </bug>

</bugzilla>