[Bug 13161] New: Services started with start-stop-daemon applet not properly destroyed when stopped

bugzilla at busybox.net bugzilla at busybox.net
Mon Aug 17 10:26:31 UTC 2020


https://bugs.busybox.net/show_bug.cgi?id=13161

            Bug ID: 13161
           Summary: Services started with start-stop-daemon applet not
                    properly destroyed when stopped
           Product: Busybox
           Version: 1.32.x
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned at busybox.net
          Reporter: al004140 at gmail.com
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

Created attachment 8561
  --> https://bugs.busybox.net/attachment.cgi?id=8561&action=edit
busybox config file used

Tested on a ARM platform, but I suppose this happens in all platforms. 

First of all create this simple loop.sh script for the test:

    # cat /root/loop.sh
    while [ 1 ]
    do
        sleep 1000
    done


A service is started with start-stop-daemon as shown:

    # start-stop-daemon -S -b -q -m -p /var/run/my.pid --exec /root/loop.sh


When checking for the service running in background, pid 14710 is found:

    # ps fax | grep loop.sh
    14710 root      0:00 {loop.sh} /bin/sh /root/loop.sh
    14793 root      0:00 grep loop.sh


Then the service is stopped with start-stop-daemon:

    # start-stop-daemon -K -p /var/run/my.pid


You can see the PID 14710 entry with a process named [loop.sh]

    # ps fax | grep loop.sh
    14710 root      0:00 [loop.sh]
    15563 root      0:00 grep loop.sh


If I repeat this start/stop cycle several times, I get this nasty output:

    # ps fax | grep loop.sh
    14710 root      0:00 [loop.sh]
    20555 root      0:00 [loop.sh]
    20633 root      0:00 [loop.sh]
    20670 root      0:00 [loop.sh]
    20707 root      0:00 [loop.sh]
    20775 root      0:00 grep loop.sh


Sending a SIGTERM or a SIGKILL to any of this PIDS doesn't helps:

    # kill -TERM 14710
    # kill -KILL 14710
    # ps fax|grep loop.sh
    14710 root      0:00 [loop.sh]
    20555 root      0:00 [loop.sh]
    20633 root      0:00 [loop.sh]
    20670 root      0:00 [loop.sh]
    20707 root      0:00 [loop.sh]
    27604 root      0:00 grep loop.sh


This has consequences with systemv services, as some of them wait until the PID
is fully removed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list