[BusyBox] bug#1190: really bad behavior with killall and find_pid_by_name()
Erik Andersen
andersen at lineo.com
Thu Jul 5 17:28:34 UTC 2001
On Fri Jun 29, 2001 at 09:17:39PM -0400, Adam Slattery wrote:
>
> package: busybox
> version: 0.52-pre
>
> boot a busybox system (using busybox init).
> do `killall -TERM asdf`.
> The system reboots. This is bad.
>
> The problem is that find_pid_by_name() will default to pid 1 if it can't
> find a matching process, and thus killall will send SIGTERM to pid 1
> (which happens to be the reboot signal).
>
> Technically this is a problem in find_pid_by_name(), but halt, reboot, and
> poweroff would need to be modified if this behavior was changed. So
> instead I relied on the fact that halt, reboot, and poweroff ask for the
> pid of "init" in order to correct the killall problem.
I went ahead and patched up find_pid_by_name() based on your patch,
and also modified halt, reboot, poweroff, and killall to be a bit more
careful. With this in place, everything seems to work as expected now,
Sorry about that,
-Erik
--
Erik B. Andersen email: andersen at lineo.com
--This message was written using 73% post-consumer electrons--
More information about the busybox
mailing list