[BusyBox] bug#1261: BusyBox] bug#1261: Ash holds some extra file descriptors open
Steve Wahl
swahl at brecis.com
Thu Aug 1 10:46:05 UTC 2002
On Thu, Aug 01, 2002 at 08:05:56PM +0400, Vladimir N. Oleynik wrote:
> Steve,
>
> I testing your new example with bash 2.0.3 and not have
> get a command prompt back immediately. Only after 30 seconds.
> Please get my real problem script :)
>
> > Does this help your imagination:
> >
> > ------------------------------
> > (
> > echo "commands to read config file go here"
> > echo "commands to do other setup for the daemon go here"
> > if [ $? -ne 0 ]
> > then
> > echo "setup commands failed" >&2
> > exit 1
> > fi
> > (
> > echo "simulating daemon"
> > sleep 30 ;
> > echo "daemon simulation complete"
> > ) 2>&1 | logger -p daemon.error -t ipsec_daemon 2>&1 &
> >
> > echo "daemon startup complete"
> > ) 2>&1 | logger -s -p daemon.error -t ipsec_setup 2>&1
> >
> > echo "Now continuing RC script."
> > ------------------------------
>
> I thought, talk went about value of an exit, not output :0
>
>
> --w
> vodz
The problem is not the value of an exit, nor the output. The problem
is that a file descriptor is not closed, so a pipe remains open and
the last logger *doesn't exit*.
I needed to add a >/dev/null to the logger in the background:
(
echo "commands to read config file go here"
echo "commands to do other setup for the daemon go here"
if [ $? -ne 0 ]
then
echo "setup commands failed" >&2
exit 1
fi
(
echo "simulating daemon"
sleep 30 ;
echo "daemon simulation complete"
) 2>&1 | logger -p daemon.error -t ipsec_daemon >/dev/null 2>&1 &
echo "daemon startup complete"
) 2>&1 | logger -s -p daemon.error -t ipsec_setup 2>&1
echo "Now continuing RC script."
--> Steve
More information about the busybox
mailing list