We have a
systemd service file with the following pertinent directives:
WantedBy directive is currently not set.
We have a cron job that executes
su –l me –c '<some command>'.
We noticed that given:
- The service is started
- The user
meis not logged into the system
Everytime the cron job finishes executing, the System V IPC queues disappears and the service restarts since the processes reading/sleeping on the queues wake up to find the queues are gone and hence enter a failed state.
After the cron job finishes we noticed the following in the syslog:
… systemd: Stopped User Manager for UID XXX
installed a file such that:
$ cat /etc/systemd/logind.conf.d/my-service.conf [Login] KillUserProcesses=no RemoveIPC=no
After reading systemd changelog for changes with 230, we are still confused if our Possible Solution mentioned above is enough.
We are confused in particular about the
additional steps are necessary to allow intentionally long-running processes to survive logout.
The services parent as reported by
system.slice so that makes us believe the prescribed step to start the service using
systemd-run does not apply here - is this true? We are currently starting the service with
systemctl start my-service.service
Would we still need to enable
lingering for the user
Thanks for help.