1

I am running Lubuntu 13.10 an have a python script that is run on boot through ~/.config/lxsession/Lubuntu/autostart. The script startes a web application and outputs various information to terminal output. I have made some changes now to the python script and wish to restart it, and keep it running in background.

Is it possible to connect/attach to the running python script through terminal so that I can see the scripts output? I tried reptyr but I get an error indicating it is a subprocess. Or, is this not possible and the only option to kill the process manually and than restart it through another terminal? Of course, on next boot the changes will take effect, but it is nice to know whether I can interact with running processes.

Thanks for your help.

qtips
  • 111

1 Answers1

0

"Connecting" to a script usually means your program is listening to a socket and you want to connect to that socket.

I guess you mean how to replace the script which is running in the background.

The simplest way is to kill the process and restart the new version to be run in the background from a terminal:

nohup python your_script.py &
warvariuc
  • 2,335