[Toybox] names_to_pid() of killall checks only first argument from /proc/*/cmdline
Yeongdeok Suh
skyducks111 at gmail.com
Mon Jul 13 18:10:49 PDT 2015
I discovered a different behavior between toybox and busybox killall.
In case of process running script,
when I run killall with the script file name, busybox kill the process,
but toybox doesn't. (and Ubuntu util also)
like this:
-------------------------------------------------------------------------------------------------------------------
# ps -ef | grep python
root+ 8095 1766 0 17:36 ? 00:00:01 /usr/bin/python
/usr/bin/terminator
root+ 26021 4400 0 18:39 pts/29 00:00:00 grep --color=auto python
#killall terminator
//busybox: kill 8095
//toybox: No such process
-------------------------------------------------------------------------------------------------------------------
In the toybox source, (lib/lib.c) names_to_pid(),
readfile() returns only first argument, "python" from /proc/*/cmdline
and compare with the argument ('terminator'), print error.
--(/proc/8095/cmdline)---------------------------------
/usr/bin/python /usr/bin/terminator
-----------------------------------------------------------------
Is this correct? Or is there any standard about this?
I can't sure which one is correct.
What I checked spec is below.
http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/killall.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20150714/1c9a8555/attachment.htm>
More information about the Toybox
mailing list