-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write daemon's PID to file on startup #10
Comments
While a PID file might be useful, the best way to run the final-pm daemon via systemd would be to directly The executable The daemon logs to stdout and stderr, meaning you can comfortably redirect logging from the parent process to wherever you want those to go. The final-pm "launcher" just sets stdout/stderr to The daemon's signal handling might need to be re-thought for that though, since I'll have to make a one-line change so the daemon doesn't expect an open IPC channel on launch, but once I've done so I'll provide an example systemd configuration and probably provide a built-in logger |
The one-line change I talked about is already in the repo if you want to try it out. There's no release (yet) though - not until some more thought went into this. Changing anything about this later on might break existing setups. |
Having final-pm run in the foreground is certainly an alternative. Maybe It could be even exposed in the CLI interface via
Either that or advise users to customize
This is already configurable via
👍 |
This would mean having all the CLI code loaded into the daemon process though. The CLI code isn't as rigorously tested as the daemon (as you already discovered yourself) and it also pulls a ton of extra dependencies. I don't really want all that in a lean daemon...
Yes. Just thinking of my own use-case here where a clean stop of a process might take as long as a few days, since it waits until all clients have disconnected. That is usually what I want when I'm just restarting my application within final-pm to get to a new version. But it's not what I'd want to happen when I'm restarting the whole server.
An added bonus of this approach is that it makes the shutdown behavior of the daemon essentially configurable via your systemd unit file, solving the issue I just raised. |
Helllo @laino! I use systemd to launch final-pm on system boot and while it's working fine (systemd is able to "guess" the just launched daemon's PID), it would be great if final-pm wrote the daemon's PID into a file (
~/.final-pm/daemon.pid
maybe?) once it's up. It would make the setup more robust. What do you think?The text was updated successfully, but these errors were encountered: