Skip to content
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

"reload" for init scripts, where applicable #58

Open
ctdk opened this issue Sep 27, 2014 · 4 comments
Open

"reload" for init scripts, where applicable #58

ctdk opened this issue Sep 27, 2014 · 4 comments

Comments

@ctdk
Copy link

ctdk commented Sep 27, 2014

Sometimes, you might want a "reload" command for an init script rather than just "restart". Unfortunately the way to do that varies between the different kinds of init systems out there. SysV init supports it with no real trouble, and systemd has ExecReload to specify a command to use to reload the program.

Beyond that, it gets a little hairy. I've been unable to find any evidence that launchd supports reload at all, and while the latest version of upstart does, I am told previous versions do not. Also, the version of upstart that does support reload only allows you to send a signal to the program in question.

So, reload would have to be implemented differently on each platform. There may not be one good way to do it across all platforms that support it, but perhaps other folks have ideas on how to best implement it across the different platforms. Any ideas?

@ctdk
Copy link
Author

ctdk commented Sep 27, 2014

For SysV and systemd, it might work to have a --reload option to pleaserun, with a sensible default (like kill -HUP $pid (or $MAINPID) that could be overridden. Upstart could use a --reload option and an optional signal (default SIGHUP) for those versions that allow it.

This feels a little clunky, but I'm not sure there's a better way.

@ctdk
Copy link
Author

ctdk commented Sep 28, 2014

Initial work on sysv and systemd at https://github.com/ctdk/pleaserun/tree/reload

@jordansissel
Copy link
Owner

Looks like a pretty good start!

@ctdk
Copy link
Author

ctdk commented Oct 7, 2014

Yeah, the changes work fine, but they need some tests before too long. Soon, hopefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants