<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV><BR>My understanding is the twistd will have a default log twistd.log. </DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks,</DIV>
<DIV>Garyc</DIV>
<DIV><BR>--- On <B>Wed, 4/21/10, Don Schoeman <I>&lt;don@delphexonline.com&gt;</I></B> wrote:<BR></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid"><BR>From: Don Schoeman &lt;don@delphexonline.com&gt;<BR>Subject: Re: [Twisted-Python] twistd and init.d<BR>To: "Twisted general discussion" &lt;twisted-python@twistedmatrix.com&gt;<BR>Date: Wednesday, April 21, 2010, 7:54 AM<BR><BR>
<DIV id=yiv391124917><FONT face=Arial>Sorry, I mean't to say I will use the full path to twistd (i.e. /usr/bin/twistd) and see if that works.</FONT><BR><BR>Don Schoeman wrote: 
<BLOCKQUOTE type="cite"><FONT face=Arial>Thanks for the tips guys,<BR><BR>Maartin, I have a feeling that you may be correct. I'm going to see if I can't set the python path within the script.<BR><BR>Tim, the only reason I can see anything in&nbsp; /var/logs/messages is because I use the "logger" tool to log those messages directly from the bash shell script. See the script below.<BR><BR>Kind Regards,<BR>Don<BR><BR></FONT><BR>Don Schoeman wrote: 
<BLOCKQUOTE type="cite"><FONT face=Arial>Hi guys,<BR><BR>My application is being executed using twistd as per documentation. All is working fine but I need to have the service start automatically at boot time.<BR><BR>So as a test I've created a script in /etc/init.d/ which looks like this:<BR><FONT face="Courier New, Courier, monospace"><BR>#! /bin/sh<BR>### BEGIN INIT INFO<BR># Provides:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ghserver<BR># Required-Start:&nbsp;&nbsp;&nbsp; $local_fs $remote_fs $network $syslog<BR># Required-Stop:&nbsp;&nbsp;&nbsp;&nbsp; $local_fs $remote_fs $network $syslog<BR># Default-Start:&nbsp;&nbsp;&nbsp;&nbsp; 2 3 4 5<BR># Default-Stop:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 1 6<BR># Short-Description: Start/stop GHServer server<BR>### END INIT INFO<BR><BR>logger "GHServer: Start script executed"<BR>GH_SERVER_PATH="/home/myname/Python/ghserver"<BR>export PYTHONPATH="$GH_SERVER_PATH:$PYTHONPATH"<BR><BR>case "$1"
 in<BR>&nbsp; start)<BR>&nbsp;&nbsp;&nbsp; logger "GHServer: Starting"<BR>&nbsp;&nbsp;&nbsp; echo "Starting GHServer..."<BR>&nbsp;&nbsp;&nbsp; twistd -y "$GH_SERVER_PATH/ghserverapp.py" -l "$GH_SERVER_PATH/ghserver.log" --pidfile "$GH_SERVER_PATH/twistd.pid"<BR>&nbsp;&nbsp;&nbsp; ;;<BR>&nbsp; stop)<BR>&nbsp;&nbsp;&nbsp; logger "GHServer: Stopping"<BR>&nbsp;&nbsp;&nbsp; echo "Stopping GHServer..."<BR>&nbsp;&nbsp;&nbsp; kill `cat $GH_SERVER_PATH/twistd.pid`<BR>&nbsp;&nbsp;&nbsp; ;;<BR>&nbsp; *)<BR>&nbsp;&nbsp;&nbsp; logger "GHServer: Invalid usage"<BR>&nbsp;&nbsp;&nbsp; echo "Usage: /etc/init.d/ghserver {start|stop}"<BR>&nbsp;&nbsp;&nbsp; exit 1<BR>&nbsp;&nbsp;&nbsp; ;;<BR>esac<BR><BR>exit 0</FONT><BR><BR><BR>This works fine when running /etc/init.d/ghserver start and</FONT><FONT face=Arial> /etc/init.d/ghserver stop. The script also run when I boot since the logger actually logs the "GHServer: Starting" text to the /var/log/messages file. However, my
 service actually does not start. There is no pid to be found anywhere, there are no error logs anywhere, just nothing. I might be doing something wrong here but is there someone who's gone through this process and can provide some samples how they did it? Any help will be greatly appreciated.<BR><BR>Kind Regards,<BR>Don<BR><BR><BR></FONT><PRE><HR width="90%" SIZE=4>
_______________________________________________
Twisted-Python mailing list
<A class=moz-txt-link-abbreviated href="http://us.mc1125.mail.yahoo.com/mc/compose?to=Twisted-Python@twistedmatrix.com" target=_blank rel=nofollow ymailto="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</A>
<A class=moz-txt-link-freetext href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target=_blank rel=nofollow>http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</A>
  </PRE></BLOCKQUOTE><PRE><HR width="90%" SIZE=4>
_______________________________________________
Twisted-Python mailing list
<A class=moz-txt-link-abbreviated href="http://us.mc1125.mail.yahoo.com/mc/compose?to=Twisted-Python@twistedmatrix.com" target=_blank rel=nofollow ymailto="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</A>
<A class=moz-txt-link-freetext href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target=_blank rel=nofollow>http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</A>
  </PRE></BLOCKQUOTE></DIV><BR>-----Inline Attachment Follows-----<BR><BR>
<DIV class=plainMail>_______________________________________________<BR>Twisted-Python mailing list<BR><A href="http://us.mc1125.mail.yahoo.com/mc/compose?to=Twisted-Python@twistedmatrix.com" ymailto="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</A><BR><A href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target=_blank>http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</A><BR></DIV></BLOCKQUOTE></td></tr></table>