From 0a9ac65609b40799e5733df2896f4b58b1b26a7c Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Tue, 8 Jul 2025 07:00:52 +0200 Subject: [PATCH] doc: update with $MAINPID notice Signed-off-by: Joachim Wiberg --- doc/config.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/config.md b/doc/config.md index dec554cd..ad21926e 100644 --- a/doc/config.md +++ b/doc/config.md @@ -918,10 +918,13 @@ configurable with the following options: `post:script` action with exit code `crashed`, see below * `reload:script [args]` -- some services do not support `SIGHUP` but may have other ways to update the configuration of a running daemon. - When `reload:script` is defined it is preferred over `SIGHUP` + When `reload:script` is defined it is preferred over `SIGHUP`. Like + systemd, Finit sets `$MAINPID` as a convenience to scripts, which in + effect also allow `reload:kill -HUP $MAINPID` * `stop:script [args]` -- some services may require alternate methods to be stopped. When `stop:script` is defined it is preferred over - `SIGTERM` and `stop`, for `service` and `sysv` stanzas, respectively + `SIGTERM` and `stop` for `service` and `sysv` stanzas, respectively. + Similar to `reload:script`, Finit sets `$MAINPID` > [!CAUTION] > Both `reload:script` and `stop:script` are called as PID 1, without