bin/113860: sh: shell is still running when using `sh -c'
Ed Schouten
ed at fxq.nl
Tue Jun 19 17:50:10 UTC 2007
>Number: 113860
>Category: bin
>Synopsis: sh: shell is still running when using `sh -c'
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Jun 19 17:50:09 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: Ed Schouten
>Release: FreeBSD 6.2-STABLE i386
>Organization:
>Environment:
System: FreeBSD palm.hoeg.nl 6.2-STABLE FreeBSD 6.2-STABLE #0: Fri Apr 20 13:44:49 CEST 2007 root at palm.hoeg.nl:/usr/obj/usr/src/sys/PALM i386
>Description:
Some bloated shell from GNU immediately shuts down the shell when using
`sh -c'. This means that:
sh -c 'sleep 10'
only keeps a sleep(1) process running for 10 seconds; the shell is
closed immediately.
FreeBSD's sh doesn't. This means that all applications that use
system(3) or just execve(2) /bin/sh leave shells running around.
>How-To-Repeat:
| $ sh -c 'sleep 10' &
| [1] 13519
| $ ps ux
| USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
| ...
| ed 13519 0.0 0.2 6228 1808 p2 SN 7:48PM 0:00.00 sh -c sleep 10
| ed 13520 0.0 0.1 2552 704 p2 SN 7:48PM 0:00.00 sleep 10
>Fix:
I looked through the sh source code, but I can't seem to find a way to
do this. I'm not an expert when it comes to patching sh(1) code. :-(
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list