<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hello Toni,<br>
<br>
maybe the "logger" command is your friend<br>
<br>
cheers<br>
<br>
On 03/27/2012 05:58 PM, Toni Castelli wrote:
<blockquote cite="mid:C1AF38FE8539462E96518057E198CDD7@XPS" type="cite">
  <div dir="ltr">
  <div
 style="font-family: 'Calibri'; color: rgb(0, 0, 0); font-size: 12pt;">
  <div>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.</div>
  <div> </div>
  <div>What im trying to run is something like this:</div>
  <div> </div>
  <div>$logFile=/var/log/test.log</div>
  <div> </div>
  <div>if [ ! "$logFile" == "" ]; then</div>
  <div>               touch $logFile || exit 2</div>
  <div>               start-stop-daemon --start --make-pidfile 
--pidfile $PIDFILE  --exec $DAEMON -- $DAEMON_ARGS  >> $logFile
2>&1 &</div>
  <div>else ....</div>
  <div> </div>
  <div>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?</div>
  </div>
  </div>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Voyage-linux mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Voyage-linux@list.voyage.hk">Voyage-linux@list.voyage.hk</a>
<a class="moz-txt-link-freetext" href="http://list.voyage.hk/mailman/listinfo/voyage-linux">http://list.voyage.hk/mailman/listinfo/voyage-linux</a>
  </pre>
</blockquote>
<br>
</body>
</html>