Answer the question
In order to leave comments, you need to log in
How to add a Python script to autoload?
You need to add the script to autoload. I tried this:
1. chmod +x script.py
2. Moved the script to /etc/init.d/
3. update-rc.d script.py start 99 2 3 4 5. stop 1 0 1 6.
But for some reason it doesn't out. What am I doing wrong?
Answer the question
In order to leave comments, you need to log in
So are links created to it in rc directories?
Maybe they forgot to specify #!/usr/bin/env python at the beginning of the script?
Or does it run but an error occurs in the code?
You can push it into rc.local or add it with defaults instead of exact instructions.
When my sort of debugged script didn't run from rc.local or from cron, often the problem was
1. $PATH different from the one with which the script was tested
2. Other environment variables may be different, which can lead to inoperability
3. Using relative paths in mcrypt instead of absolute. At the same time, the script does not find the files necessary for work and drops out
create a .sh script with the contents
then autoload it
#!/bin/sh
python /path/to/script.py
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question