aboutsummaryrefslogtreecommitdiff
path: root/src/rc/supervise-daemon.c
AgeCommit message (Collapse)Author
2019-03-29supervise-daemon: allow --respawn-max to be zeroWilliam Hubbs
2018-12-24src/rc/supervise-daemon.c: formatting fixesphilhofer
Fix misleading indentation and other erroneous whitespace. This fixes #273.
2018-12-23src/rc/supervise-daemon.c: do not pass NULL to strcmpphilhofer
The following will cause a segfault due to NULL being passed to strcmp(3) $ RC_SVCNAME=foo supervise-daemon Fix the bounds check on argc in main. If argc<=1, then it is not safe to dereference argv[1].
2018-12-21fix compiler warningsWilliam Hubbs
2018-12-20supervise-daemon: do not use the exec_service() functionWilliam Hubbs
In order to run healthcheck() and the unhealthy() function, add an exec_command call to the supervisor. Another difference is This function also logs errors instead of attempting to display them. This is for #271.
2018-12-06supervise-daemon: fix busy loopWilliam Hubbs
This fixes #264.
2018-12-04supervise-daemon: redirect std{in,out,err} to /dev/null after demonizingAlexander Zubkov
This fixes #239.
2018-12-03src/rc/supervise-daemon.c: fix style issueAustin English
This is for #263.
2018-12-03supervise-daemon: use a default pid file if one is not specifiedWilliam Hubbs
Since the pid file is internal to us, start moving toward deprecating it by not requiring the user to specify it. In the next release, I plan on working on code to start phasing out the use of a pid file if this is possible.
2018-12-02supervise-daemon: mark a service failed if it respawns too many timesWilliam Hubbs
2018-12-02supervise-daemon: make respawn-max and respawn-period independent settingsWilliam Hubbs
2018-12-02supervise-daemon: add support for a fifoWilliam Hubbs
This will allow us to signal the daemon we are supervising as well as send other commands to the supervisor in the future. This fixes #227.
2018-12-02supervise-daemon: rework signal handling and main loopWilliam Hubbs
This is needed in preparation for adding support for a fifo to allow us to communicate with the supervisor to ask it to signal the child it is supervising.
2018-11-28supervise-daemon: fix type of exiting flagWilliam Hubbs
2018-11-15supervise-daemon: make the pidfile an implementation detailWilliam Hubbs
The pidfile of the supervisor doesn't need to be adjustable by the service script. It is only used so the supervisor can stop itself when the --stop option is used.
2018-11-05supervise-daemon: reap zombiesWilliam Hubbs
We need to make sure to reap zombies so that we can shut down successfully. Fixes #252. Possibly related to #250.
2018-10-23supervise-daemon: add health checksWilliam Hubbs
Health checks are a way to monitor a service and make sure it stays healthy. If a service is not healthy, it will be automatically restarted after running the unhealthy() function to clean up.
2018-10-15supervise-daemon: fix respawn_max off by oneZac Medico
Fix the comparison between respawn_count and respawn_max so that respawn_max = 1 will allow for one respawn. Since respawn_count is incremented before the comparison, use a 'greater than' comparison so that respawn will be triggered when respawn_count is equal to respawn_max. Fixes: https://github.com/OpenRC/openrc/issues/247 Fixes: https://github.com/OpenRC/openrc/issues/248
2018-10-13misc: whitespace fixesAustin English
2018-10-06supervise-daemon: use nanosleep() instead of sleep()William Hubbs
We will be using sigalrm in this process for health checking, and sigalrm cannot be used with sleep() safely.
2018-06-27supervise-daemon.c: clean up memory leaksWilliam Hubbs
2018-06-19supervise-daemon: convert snprintf calls to xasprintfWilliam Hubbs
2018-03-14supervise-daemon: fix off-by-one errorWilliam Hubbs
2018-02-27supervise-daemon: make an error message more verboseWilliam Hubbs
2018-02-22supervise-daemon: zero out the cmdline buffer when it is allocatedWilliam Hubbs
2018-02-21supervise-daemon: remove references to PATH_MAXWilliam Hubbs
2017-11-27fix FreeBSD buildWilliam Hubbs
This is for #186.
2017-10-30fix issue with --reexec callWilliam Hubbs
2017-10-27supervise-daemon: use RC_SVCNAME as the first argument to the daemonWilliam Hubbs
This makes ps show which service the supervisor is monitoring.
2017-10-27supervise-daemon: fix logging for reexec and the child command lineWilliam Hubbs
2017-10-27log as supervise-daemon not the serviceWilliam Hubbs
2017-10-26supervise-daemon: clarify a log messageWilliam Hubbs
2017-10-26supervise-daemon: log the command line we run to spawn the child processWilliam Hubbs
2017-10-26supervise-daemon: log with the service name instead of "supervise-daemon"William Hubbs
2017-10-26supervise-daemon: remove child_pid from saved options during shutdownWilliam Hubbs
This allows us to detect when the supervisor dies unexpectedly because in that case child_pid will still exist.
2017-10-24supervise-daemon: fix build issue for >=glibc-2.26William Hubbs
X-Gentoo-Bug: 635334 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=635334
2017-10-24supervise-daemon: multiple fixesWilliam Hubbs
- Harden against dying by handling all signals that would terminate the program and adding --reexec support - factor the supervisor into its own function - fix test for whether we are already running
2017-10-18supervise-daemon: elevate some log messages to warningsWilliam Hubbs
Prior to this change, we were logging unexpected terminations of daemons we were supervising at the info level. This change moves the logs to warnings.
2017-09-18ignore sigchld when shutting down the supervised processWilliam Hubbs
We need to do this to skip the zombie state for the child process since we are not easily able to wait() for it.
2017-09-18typo fixWilliam Hubbs
2017-09-18typo fixWilliam Hubbs
2017-09-18supervise-daemon: code cleanupWilliam Hubbs
Clean up the process for killing an active supervisor when stopping.
2017-09-14add quiet switch to do_stop in src-schedules.cWilliam Hubbs
This allows supervise-daemon to run this code without attempting to print some status messages used by start-stop-daemon.
2017-09-06add quiet parameter to run_stop_scheduleWilliam Hubbs
2017-09-06add retry option to supervise-daemonWilliam Hubbs
The --retry option for supervise-daemon defines how the supervisor will attempt to stop the child process it is monitoring. It is defined when the supervisor is started since stopping the supervisor just sends a signal to the active supervisor. This fixes #160.
2017-08-23move get_pid function to a shared fileWilliam Hubbs
2017-05-12supervise-daemon: save start time and respawn count before dropping privsWilliam Hubbs
2017-05-11fix from_time_t functionWilliam Hubbs
2017-05-11Move time_t conversions to rc-misc.c so they can be sharedWilliam Hubbs
2017-05-11supervise-daemon: save start time and respawn countWilliam Hubbs
This will allow rc-status to display an uptime and restart count for supervised processes.