[BusyBox 0001576]: ash -c causes two processes (compatibility issue)
bugs at busybox.net
bugs at busybox.net
Tue Nov 6 13:30:37 UTC 2007
The following issue has been SUBMITTED.
======================================================================
http://busybox.net/bugs/view.php?id=1576
======================================================================
Reported By: jensnachtigall
Assigned To: BusyBox
======================================================================
Project: BusyBox
Issue ID: 1576
Category: Other
Reproducibility: always
Severity: minor
Priority: normal
Status: assigned
======================================================================
Date Submitted: 11-06-2007 05:30 PST
Last Modified: 11-06-2007 05:30 PST
======================================================================
Summary: ash -c causes two processes (compatibility issue)
Description:
background:
===========
I use a software that starts plugins via the -c flag of the shell, and
then to unload/stop the plugin again, it sends SIGTERM or SIGKILL to the
plugin's pid. See the code snippet:
void Plugin::start() {
[...]
pid = fork();
[...]
execl("/bin/sh", "/bin/sh", "-c", (cmdline + " " + name).c_str(),
NULL);
}
This works fine with bash, where a command like "bash -c "sleep 10""
results in just one process, namely just in the "sleep 10" process.
However, with ash a command like "ash -c "sleep 10"" results in 2
processes, namely first "ash -c sleep 10" and then "sleep 10".
For the above software this means that
pid = fork()
is the pid of "ash -c <plugin-command>" and not of "<plugin-command>, so
the signals go to the "ash -c <plugin-command>" and not to
"plugin-command" as it was with bash.
Would be nice if ash behaved in the same way as bash (and probably other
shells) by just starting the command after the "-c" option (that is, one
command).
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
11-06-07 05:30 jensnachtigall New Issue
11-06-07 05:30 jensnachtigall Status new => assigned
11-06-07 05:30 jensnachtigall Assigned To => BusyBox
======================================================================
More information about the busybox-cvs
mailing list