Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 185903 - baselayout tries to kill process itself, but fails.
Summary: baselayout tries to kill process itself, but fails.
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-19 20:06 UTC by Peter Volkov (RETIRED)
Modified: 2007-07-20 13:16 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 Peter Volkov (RETIRED) gentoo-dev 2007-07-19 20:06:46 UTC
This problem is reproducible in bug 174236. Init script itself calls start-stop-daemon both for start and for stop which works fine for rwhod, so this works fine (exit status 0 in both cases):

camobap ~ # start-stop-daemon --start --quiet --exec /usr/sbin/rwhod -- -b
camobap ~ # start-stop-daemon --stop --quiet --name rwhod

On the other hand /etc/init.d/rwho stop fails. IIUC init script instead of s-s-d calls rc_stop_daemon (from rc-daemon.sh) which attempts to stop the process. While it detect ${pids} correctly (see code, for quick reference:

        for pid in ${pids}; do
[snip]
                if rc_kill_pid "${pid}" false ; then
                        # Remove the pidfile if the process didn't
                        [[ -f ${pidfile} ]] && rm -f "${pidfile}"
                else
                        retval=1
                fi
[snip]
        done

), first it tries to kill the child which enters <defunct> state and does not die:

root      5043  0.0  0.0   1744   444 ?        Ss   23:50   0:00 rwhod -b
root      5044  0.0  0.0      0     0 ?        Z    23:50   0:00 [rwhod] <defunct>

and thus rc_kill_pid returns false and retval became equal to 1 and stop fails.

So the question here is, how to force baselayout use s-s-d? Or may be it's better to fix rc_stop_daemon logic?
Comment 1 Roy Marples (RETIRED) gentoo-dev 2007-07-20 13:16:38 UTC
Yeah, we've totally changed this handling for baselayout-2.

I'm not really interested adding corner case fixes to baselayout-1 at this time. The workaround is to call the s-s-d binary by path in the init script.