DiamondLightSource / pythonSoftIOC

Embed an EPICS IOC in a Python process
Apache License 2.0
31 stars 9 forks source link

How to use a pythonSoftIOC script with systemd? #112

Closed asarkar-parsys closed 1 year ago

asarkar-parsys commented 1 year ago

Hi,

Has anyone tried launching pythonSoftIOC as a daemon with systemd? My softioc script is based on the simple example you've provided, which defines the IOCs, the actions and then drops into interactive shell. This seems to work well when I launch the python script manually. However, while launching the same via systemd as a daemon, systemd reports that the the service has been launched but it is in inactive (dead) state. On digging further, it looks like the script has reached the interactive shell but the process seems to exit, which is why systemd thinks that the service has completed. I have tried using TYPE for the service to be "oneshot" or "fork", however fork does not show up in the strace. If someone has successfully used it with systemd then it will be great if the .service file could be shared.

Is it possible to use Procserv while using pythonSoftIOC?

Thanks in advance.

Abhik