[Voyage-linux] log the stdout of a process started by start-stop-daemon
Frank Hoeflich
(spam-protected)
Wed Mar 28 14:50:23 HKT 2012
Toni:
Between Voyage 0.6.5 (Lenny) and Voyage 0.7.5 (Squeeze) Debian changed the default sh from bash to dash, and at the time it did indeed cause one of the /bin/sh Voyage scripts to break for me (dash was broken somehow with regard to quoting, don't remember if stdout was a casualty). I ended up explicitly using /bin/bash in my reworked version of the script and never had a problem again.
Try both #!/bin/dash and #!/bin/bash explicitly in your script and report back what you find along with your Voyage version, please.
--Frank
--- On Tue, 3/27/12, Teco Boot <teco at inf-net.nl> wrote:
From: Teco Boot <teco at inf-net.nl>
Subject: Re: [Voyage-linux] log the stdout of a process started by start-stop-daemon
To: "Toni Castelli" <acastelli at keonn.com>
Cc: voyage-linux at voyage.hk
Date: Tuesday, March 27, 2012, 11:39 PM
I did have same kind of issue. I started using bash instead of sh.(1st line: #!/bin/bash)Maybe it is a dirty bypass and I should use a clean sh script.Teco
Op 27 mrt. 2012, om 17:58 heeft Toni Castelli het volgende geschreven:
Hello, I’m having some trouble trying to log the stdout and the
stderror generated by an application when it is started by an init.d
script.
What im trying to run is something like this:
$logFile=/var/log/test.log
if [ ! "$logFile" == "" ]; then
touch $logFile || exit 2
start-stop-daemon --start --make-pidfile --pidfile $PIDFILE --exec
$DAEMON -- $DAEMON_ARGS >> $logFile 2>&1 &
else ....
when I try to run the script from bash it works perfectly, but when it runs
after a reboot, the log file isn’t generated. I’m suspecting it could be a
matter of mounting the file system after starting my script, but I’ve checked
the execution number and its the last one it shares the number with some other
processes). Anyone can guess what’s wrong with the
code?
_______________________________________________
Voyage-linux mailing list
Voyage-linux at list.voyage.hk
http://list.voyage.hk/mailman/listinfo/voyage-linux
-----Inline Attachment Follows-----
_______________________________________________
Voyage-linux mailing list
Voyage-linux at list.voyage.hk
http://list.voyage.hk/mailman/listinfo/voyage-linux
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.voyage.hk/pipermail/voyage-linux/attachments/20120327/28f811ea/attachment.html>
More information about the Voyage-linux
mailing list