<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<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 cite="mid:4BCEF40A.1060405@delphexonline.com" type="cite">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <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 cite="mid:4BCEE3A1.10601@delphexonline.com" 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 wrap=""><hr size="4" width="90%">
_______________________________________________
Twisted-Python mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a>
  </pre>
  </blockquote>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Twisted-Python mailing list
<a class="moz-txt-link-abbreviated" href="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">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a>
  </pre>
</blockquote>
</body>
</html>