Thanks for reporting back to the list, Don.  I&#39;m sure this info will help someone down the road (maybe even me!)<br><br>Kevin Horn<br><br><div class="gmail_quote">On Thu, Apr 22, 2010 at 9:11 AM, Don Schoeman <span dir="ltr">&lt;<a href="mailto:don@delphexonline.com">don@delphexonline.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


  

<div bgcolor="#ffffff" text="#000000">
<font face="Arial">Hi guys,<br>
<br>
I have finally managed to solve this problem. It turns out (as
predicted) that this is not a twistd problem after all. This particular
Ubuntu server has an encrypted home directory (enabled through
eCryptfs). This means that during the boot process the particular home
directory from which I tried running my tests was not available as even
the root user do not have access to the home directory until it is
de-crypted after the particular user actually logs in. This is why the
tests ran fine after login but not during boot.<br>
<br>
For more experienced Linux admins this would have been tracked down
within minutes but it took me a full day worth of testing before I
finally managed to track down the problem. To resolve the issue I moved
the server to /usr/local/lib/python2.6/dist-packages/ghserver and I am
now executing it from there instead and it starts up during boot just
as expected. I am extremely relieved!<br>
<br>
Thanks all again for your help!<br>
<br>
Best Regards,<br>
Don<br>
</font><br>
<br>
Don Schoeman wrote:
<blockquote type="cite"><div><div></div><div class="h5">
  
  
  <font face="Arial">Hi Jason,<br>
  <br>
Unfortunately I still have the same problem. However, I now realise
that it might be a privileges issue of some kind. Being fairly new at
linux  this may take days to figure out; can you perhaps remember if
you enabled your rc script using the command update-rc.d? I used it in
the following way: sudo update-rc.d ghserver defaults<br>
  <br>
Since this doesn&#39;t seem to be a problem related to twisted or twistd
anymore I will start looking elsewhere for possible solutions.<br>
  <br>
Thanks for all the help from everyone anyway.<br>
  <br>
Regards,<br>
Don<br>
  <br>
  </font><br>
Jason J. W. Williams wrote:
  <blockquote type="cite">
    <pre>Hi Don,

Here&#39;s the init.d we use for Twisted on Ubuntu. Sets the full path to Twistd:

<a href="http://gist.github.com/373978" target="_blank">http://gist.github.com/373978</a>

-J

On Wed, Apr 21, 2010 at 5:38 AM, Don Schoeman <a href="mailto:don@delphexonline.com" target="_blank">&lt;don@delphexonline.com&gt;</a> wrote:
  </pre>
    <blockquote type="cite">
      <pre>Hi guys,

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.

So as a test I&#39;ve created a script in /etc/init.d/ which looks like this:

#! /bin/sh
### BEGIN INIT INFO
# Provides:          ghserver
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start/stop GHServer server
### END INIT INFO

logger &quot;GHServer: Start script executed&quot;
GH_SERVER_PATH=&quot;/home/myname/Python/ghserver&quot;
export PYTHONPATH=&quot;$GH_SERVER_PATH:$PYTHONPATH&quot;

case &quot;$1&quot; in
  start)
    logger &quot;GHServer: Starting&quot;
    echo &quot;Starting GHServer...&quot;
    twistd -y &quot;$GH_SERVER_PATH/ghserverapp.py&quot; -l
&quot;$GH_SERVER_PATH/ghserver.log&quot; --pidfile &quot;$GH_SERVER_PATH/twistd.pid&quot;
    ;;
  stop)
    logger &quot;GHServer: Stopping&quot;
    echo &quot;Stopping GHServer...&quot;
    kill `cat $GH_SERVER_PATH/twistd.pid`
    ;;
  *)
    logger &quot;GHServer: Invalid usage&quot;
    echo &quot;Usage: /etc/init.d/ghserver {start|stop}&quot;
    exit 1
    ;;
esac

exit 0


This works fine when running /etc/init.d/ghserver start and
/etc/init.d/ghserver stop. The script also run when I boot since the logger
actually logs the &quot;GHServer: Starting&quot; 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&#39;s gone through this process
and can provide some samples how they did it? Any help will be greatly
appreciated.

Kind Regards,
Don



_______________________________________________
Twisted-Python mailing list
<a href="mailto:Twisted-Python@twistedmatrix.com" target="_blank">Twisted-Python@twistedmatrix.com</a>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a>


    </pre>
    </blockquote>
    <pre>_______________________________________________
Twisted-Python mailing list
<a href="mailto:Twisted-Python@twistedmatrix.com" target="_blank">Twisted-Python@twistedmatrix.com</a>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a>

  </pre>
  </blockquote>
  </div></div><pre><hr width="90%" size="4"><div class="im">
_______________________________________________
Twisted-Python mailing list
<a href="mailto:Twisted-Python@twistedmatrix.com" target="_blank">Twisted-Python@twistedmatrix.com</a>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a>
  </div></pre>
</blockquote>
</div>


<br>_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="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>
<br></blockquote></div><br><div style="visibility: hidden; display: inline;" id="avg_ls_inline_popup"></div><style type="text/css">#avg_ls_inline_popup {  position:absolute;  z-index:9999;  padding: 0px 0px;  margin-left: 0px;  margin-top: 0px;  width: 240px;  overflow: hidden;  word-wrap: break-word;  color: black;  font-size: 10px;  text-align: left;  line-height: 13px;}</style>