exec and dead children
Nils Kassube
kassube at gmx.net
Fri Dec 4 10:14:18 UTC 2015
Karl Auer wrote:
> On Fri, 2015-12-04 at 08:46 +0100, Nils Kassube wrote:
> > Nils Kassube wrote:
> > Sorry, forget about the "wait" command - it doesn't work.
>
> Yes, I know, I was tactfully ignoring that advice :-)
Thanks. :)
> > However there is a way that does work:
> > #!/bin/sh
> > firefox $ARGS <&- >&- 2>- &
>
> Well, that's new to me, I have not seen that syntax before. However,
> it doesn't work for me.
>
> With or without nohup, whether redirecting as you suggest or
> redirecting to a file or redirecting to /dev/null, I still need a
> delay or everything dies. Without nohup everything dies anyway.
That's a bit strange to me because I tried it several times and it
always worked. Granted, initially I used it without $ARGS, but even now
if I use it with $ARGS, it doesn't make a difference.
> Did you perhaps have a firefox window already open when you exec-ed
> your script? If you did, it will work - with or without nohup, and
> with or without a delay.
No, there was no firefox running. The script always returned
immediately. Here is my (new) version of the script.
~/ > cat x.sh
#!/bin/sh
ARGS="-new-window http://slashdot.org"
ARGS="$ARGS -new-window http://apod.nasa.gov/apod/ap151203.html"
firefox $ARGS <&- >&- 2>- &
~/ > ps ax|grep firefox|grep -v grep
~/ > ./x.sh
~/ > ls -l ./x.sh
-rwx------ 1 nils nils 142 Dec 4 11:01 ./x.sh
~/ > ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Feb 19 2014 /bin/sh -> dash
I tried it several times with various URLs and it always worked. Now I
wonder if it perhaps only works with KDE (I'm using Kubuntu) and not
with another DE. At least there is no difference if I start it from
konsole or xterm. And it even works, if I start it on another (Kubuntu)
machine via ssh.
Nils
More information about the ubuntu-users
mailing list