start-stop-daemon and python

前端 未结 2 2228
再見小時候
再見小時候 2021-02-20 13:12

I\'m trying to start python script with start-stop-daemon:

sudo /sbin/start-stop-daemon --start --pidfile /home/loop.pid \\ 
--user www-data --group www-data -b          


        
2条回答
  •  清酒与你
    2021-02-20 13:43

    I tried your script and command line, and it is working on my machine. Are you sure your script is located at /home/loop.py?

    Also, don't expect to see those prints, because you are specifying the -b (background) option, so the process is being detached from your terminal. Try running it without the -b for testing purposes and then you can redirect the standard output to a logfile with the -stdout option:

    sudo /sbin/start-stop-daemon --start --pidfile /home/loop.pid \ 
    --user www-data --group www-data -b --make-pidfile --chuid www-data \
    --exec /usr/bin/python /home/loop.py --verbose -stdout /var/log/loop.log
    

提交回复
热议问题