<br><br><div><span class="gmail_quote">On 8/9/07, <b class="gmail_sendername">Udo Richter</b> <<a href="mailto:firstname.lastname@example.org">email@example.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Petri Helin wrote:<br>> Udo Richter wrote:<br>>> I *think* that these are kill signals received by the child process.<br>>> Which is strange, as the child does an exit immediately. (Unless you're<br>>> somewhere between
1.5.1 and 1.5.3 - this changed in 1.5.4)<br>>><br>>> 6 is SIGABRT, 11 is SIGSEGV and 9 is SIGKILL.<br>><br>> I use version 1.5.6. I tested with my normal shutdown script and with a<br>> script that just does an "exit 0". No difference there. Can the script
<br>> itself have any influence on the return value?<br><br>Since 1.5.4, VDR forks into a child that does nothing but fork off a<br>second child, and do an exit(0). The second child exec's the shutdown<br>script:<br>
<br>VDR<br> +-- Child 1 -> exits<br> +-- Child 2 -> runs shutdown<br><br>That way the waitpid quickly returns, the second child becomes orphaned,<br>and no process ends up being a zombie.<br><br>Since the shutdown script runs orphaned, the return value of the script
<br>is not evaluated, nor does anyone wait for the script to terminate.</blockquote><div><br><br>I noticed my vdr-1.5.6 did an emergency shutdown when I had poor signal reception during a recording, which in itself is a fine thing to do... but my "runvdr" script didn't seem to catch the bad exit code (exit 1) when vdr did that, so VDR never restarted. This code snippet used to work for me, but doesn't now:
<br><br> eval "screen -D -m -S vdr $VDRCMD &"<br> # Remember PID of VDR process<br> PID=$!<br> # Wait for VDR to end or signal to arrive<br> wait $PID<br> # Remember return value of VDR
<br> RET=$?<br> if test $RET -eq 0 -o $RET -eq 2; then exit; fi<br> TIMEOFDEATH=$(date +%s)<br><br>so, something is wrong with RET. Does this have to do with the children spawning the exit code?<br><br>Groeten.