<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Arial">I still get the same results (or non-results)
unfortunately.</font> I have tried the following options:<br>
<br>
1) Tried running twistd by giving the fully qualified path:
/usr/bin/twistd.<br>
2) Tried running the .tac file together with the -g twistd switch
instead.<br>
3) Tried the --syslog switch to see if I can find anything in the logs.<br>
4) Tried running it without supplying custom log and pid files.<br>
<br>
It almost seems to me that twistd thinks that it started the daemon
fine, although it clearly does not. Can anyone tell me if twistd
returns any error codes, maybe I can check that? Please note again,
running it with "/etc/init.d/ghserver start" still works flawlessly, it
is only when I try and run during the boot process.<br>
<br>
I am starting to think that I should perhaps try running it from
/etc/rc.local instead.<br>
<br>
Regards,<br>
Don<br>
<br>
<br>
<br>
<br>
gary clark wrote:
<blockquote cite="mid:924638.49082.qm@web112508.mail.gq1.yahoo.com"
 type="cite">
  <table border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td
 style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;"
 valign="top">
        <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><a class="moz-txt-link-rfc2396E" href="mailto:don@delphexonline.com">&lt;don@delphexonline.com&gt;</a></i></b>
wrote:<br>
        </div>
        <blockquote
 style="border-left: 2px solid rgb(16, 16, 255); padding-left: 5px; margin-left: 5px;"><br>
From: Don Schoeman <a class="moz-txt-link-rfc2396E" href="mailto:don@delphexonline.com">&lt;don@delphexonline.com&gt;</a><br>
Subject: Re: [Twisted-Python] twistd and init.d<br>
To: "Twisted general discussion"
<a class="moz-txt-link-rfc2396E" href="mailto:twisted-python@twistedmatrix.com">&lt;twisted-python@twistedmatrix.com&gt;</a><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 size="4" width="90%">
_______________________________________________
Twisted-Python mailing list
<a moz-do-not-send="true" 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 moz-do-not-send="true" 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 size="4" width="90%">
_______________________________________________
Twisted-Python mailing list
<a moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true"
 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 moz-do-not-send="true"
 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>
    </tbody>
  </table>
  <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>