How to run python script as root?

Hi all. You have a server on Centos 7. Spinning it skriptik on python. During reboot, the script is raised but not working.
In cron-e every 5 minutes work task. The meaning of this. If no ps in the name, then start creaking type
nohup python /root/rtl/script.py &
In the output ofps aux | grep script it shows that it's running as root there is a pid but the script does not show any activity. When run from console or terminal, everything works as it should. What is the reason or what am I doing wrong.
July 12th 19 at 17:06
1 answer
July 12th 19 at 17:08
nohup /usr/bin/python /root/rtl/script.py &
try this
tried. The result is the same. The script is run, there is no effect( - Beulah.Goodwin22 commented on July 12th 19 at 17:11
: what's in the logs? - Annabell_Kerluke commented on July 12th 19 at 17:14
: In the log need script nothing. If you run the hands, you receive what you need.
In the log task in the crown of all good. The script fulfills normally. - Beulah.Goodwin22 commented on July 12th 19 at 17:17
try to change /usr/local/bin/python2.7 or /usr/local/bin/python3, depending on Your version of Python - Annabell_Kerluke commented on July 12th 19 at 17:20
: Does not start
python is in /usr/bin
accordingly /usr/bin/python2.7 /root/rtl/script.py & also not working
root 32313 1.4 0.7 239652 15112 ? S 10:30 0:00 /usr/bin/python2.7 /root/rtl/script.py
But no signs of life(( - Beulah.Goodwin22 commented on July 12th 19 at 17:23

Find more questions by tags PythonCentOS