You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example in the repo shows how to gracefully restart a standalone executable. In the case of systemd managed services, how can one make the spawned child process to be managed by systemd? The child process creation is encapsulated in the library(the Command::spawn call) and as far as I know this kind of child processes are not directly managed by systemd, meaning when the parent process eventually exits, the systemd will think the service is down and try to restart it, disregarding the child process.
Not a Linux expert myself but I do want to use this in my Rust project. Any help is greatly appreciated.
The text was updated successfully, but these errors were encountered:
systemd will think the service is down and try to restart it
In our experience, systemd will manage a forked process as the main PID once the previous main process terminates. What unit settings are you using where you observe this behaviour?
systemd will think the service is down and try to restart it
In our experience, systemd will manage a forked process as the main PID once the previous main process terminates. What unit settings are you using where you observe this behaviour?
Initially I observed this behavior on Debian 12 with a usual service unit, later I learned from tableflip that I need to add a line PIDFile=/path/to/pid-file to the service section. It then worked for my golang project with tableflip. I'm still adapting my Rust project for shellfilp, in the meantime I found out that shellflip is sending notifications on the Unix socket with path reading from env var NOTIFY_SOCKET. Does this mean I should setup the service unit with type notify? I previously always use simple type(for tableflip as well), which might be the reason the issue arises in the first place?
The example in the repo shows how to gracefully restart a standalone executable. In the case of systemd managed services, how can one make the spawned child process to be managed by systemd? The child process creation is encapsulated in the library(the
Command::spawn
call) and as far as I know this kind of child processes are not directly managed by systemd, meaning when the parent process eventually exits, the systemd will think the service is down and try to restart it, disregarding the child process.Not a Linux expert myself but I do want to use this in my Rust project. Any help is greatly appreciated.
The text was updated successfully, but these errors were encountered: