You will not be able to interact with the script run by rc.local
. But you can see what it does by logging its output into dedicated files:
python myscript.py > /home/myhome/log/myscript.log 2> /home/myhome/log/myscript.err
where error messages go into a separate log file.
Note that your script will be executed by root, having permissions and ownership accordingly.
Here's a link to an earlier answer about this with a method to log all outputs of rc.local
.
Now you can see in your log file, if the execution stops due to the script demanding input or indeed crashing, and then you can fix the script accordingly.
If you don't want to mess with rc.local
for testing, you could also first run it through crontab
on your or root's account (scheduled execution by user, see man crontab
). This might be easier for debugging, and you can start it through rc.local
once it works as you want.