Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I run initctl start my-service the shell just hangs, and the server.py is not running.

server.py doesnt fork or anything, hence the use of start-stop-daemon. Its a flask rest app.

I also notice that the pidfile doesnt get created. Maybe thats just because it hasnt started.

description "Run the server"

env USER=user1
env GROUP=user1
env HOME=/home/user1/projects/server

start on runlevel [2345]
stop on runlevel [06]

expect daemon
exec start-stop-daemon --pidfile ${HOME}/RUNNING_PID --chuid $USER:$GROUP -d ${HOME} --exec ${HOME}/server.py --background --start  

How do I configure upstart and start-stop-daemon to start server.py as a service? Thanks.

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.