I have a daemon script in /etc/init.d that performs some background packet logging using the tcpdump command. The script starts up fine using an interactive shell using sudo /etc/init.d/packetlog start
When I execute the same command through my fabric script (below) the command returns successfully but the process is not running.
def startpacketlog(): sudo(r'/etc/init.d/packetlog start')
Further to this, the service does not start automatically on boot as I had expected.
Some tips for troubleshooting this would be appreciated
Update This seems to be a general problem with starting any service on this host using fabric. When starting the apache2 service I get the same problem. I can stop the service using fabric successfully though.
Update 2 After re-reading the documentation and some experimentation the following change fixed the problem. (This disables the remote pseudo-terminal, whatever that is)
def startpacketlog(): sudo(r'/etc/init.d/packetlog start',pty=False)