User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2
On 1/10/07 22:42, Christoph Ewering wrote:
Hello Axel!
Am 01.10.2007 um 11:55 schrieb Axel Luttgens:
[...]
Could you show us a minimal sample script that reproduces the lack
of entries in the log?
Okay, I wrote a really simple script that pings a host every 30
seconds and when it gets a signal it should send a final ping. When
it receives the signal it writes into the log-file, but I get no ping
answer logged. I think the interfaces are already down when my script
wants to send the final ping.
Indeed, at shtutdown time, one never may assume that everything is still
available.
But, in your case, there may be an additional cause for the lack of
interactivity (log and/or network).
[...]
Okay here comes my little test-script and my plist-file (when I can
not find a bug in my real work-script I am going to post it also):
[...]
Fine! Thanks for having taken the time to devise that script: it is
always easier to reason on facts :-)
The problem could be with the sleep command: not being a builtin, it is
executed as a child process. As a result, it is very likely that the
TERM signal sent by launchd (assuming there is one) arrives during the
sleep, so that its handling by your script may be delayed; if too long,
the delay may then lead launchd to just kill your script (with a SIGKILL).
while [ $RUNFOREVER ]; do
/bin/sleep 30 &
wait $!
if [ $GOT_TERM ]; then
/bin/echo "just got the signal to stop"
/sbin/ping -c 1 target.host.net
/bin/echo "ping done going to stop now"
exit
fi
/sbin/ping -c 1 target.host.net
/bin/echo "still working"
done
[...]
As far as I can tell, your plist seems to be OK.
I guess you have put it into /Library/LaunchDaemons?
HTH,
Axel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden