1

Running Python Script at boot as a particular user

view story
linux-howto

http://serverfault.com – I want to run a python script at boot as a particular user. The script is a server (listens on a socket, serves requests, etc) and should be run in the background, with any output preferably piped to a log file. My current approach is to add an entry at the end of rc.local like this: su -l usr -c 'script.py arg1 arg2 &> logfile.log &' The problem: In the script i have several print statements in the script. They never show up in the log file. I've tried su -l usr -c 'script.py arg1 arg2 &> logfile.log &' su -l usr -c 'script.py arg arg &> logfile.log &' &> sec (HowTos)