0

I have a pubsub python script. When I run the receiver script and send to the background using nohup and &, and close the ssh session, the process is killed.

Is there any way to run receiver all the time?

Edward
  • 2,509

1 Answers1

0

Welcome to U&L.

This might be of help: Why does my Python background process end when SSH session is terminated?

BTW: starting a process in the shell and counting on it to stay available is not the recommended way to go. Have you considered writing a custom systemd service unit file to accomodate background service behaviour?

A quick search gives for example: https://tecadmin.net/setup-autorun-python-script-using-systemd/

For a manual: https://www.freedesktop.org/software/systemd/man/systemd.service.html

Edward
  • 2,509