Answer the question
In order to leave comments, you need to log in
Trouble with autoloading python script?
There is a script working with COM-port. I added it to autoload by creating a file with the launch command in /etc/init.d/ After rebooting, top sees the Python process, but the script itself does not react to interacting with the port. It is worth running the script manually, as everything works fine. What could be the reason?
Answer the question
In order to leave comments, you need to log in
1. is this your script? Script only in /etc/init.d/? then the command is also required update-rc.d scriptname defaults 80 to create symlinks in /etc/rc?.d
2. do you start the script as root when checking manually? if not, maybe the environment is not configured, try sudo -H -u UsernameFromWhich works
3. look - what are the errors from this script.
And the rights to the port file-device would be checked too.
And with top, use lsof / fuser /… to see if the port is actually open.
Well, the conclusion from the script itself is a harsh, proven tool.
You need to log not only the print output, but also errors. To do this, the launch line should be like this.
/usr/bin/python /path/to/script.py >>/tmp/pyscript.log 2>&1
The problem is most likely really in the launch of xrandr. This utility requires xx to be running and the DISPLAY environment variable set. Try to run as:
DISPLAY=:0.0 xrandr -o left
Although it is possible that the script starts xrandr even before the x itself starts.
As an option, you can put the script into autoload (after the start of the Xs) gdm, window manager or .xinitrc
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question