Sync documentation and manual page

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2025-02-23 05:35:00 +01:00
1 parent b75b107d6d
commit 2c95f091ee
2 files changed
+42 -27

No files matched your search

+3 -2
View File
@@ -919,9 +919,10 @@ argument, but get a set of environment variables:
* `SERVICE_ID=1` * `SERVICE_ID=1`
The `post:script` is called with an additional set of environment The `post:script` is called with an additional set of environment
variables: variables. Yes, the text is correct, the naming was an accident:
- `EXIT_CODE=[exited,signal]`: set to one of `exited` or `signal` - `EXIT_CODE=[exited,signal,crashed]`: normal exit, signaled, or
crashed
- `EXIT_STATUS=[num,SIGNAME]`: set to one of exit status code from - `EXIT_STATUS=[num,SIGNAME]`: set to one of exit status code from
the program, if it exited normally, or the signal name (`HUP`, the program, if it exited normally, or the signal name (`HUP`,
`TERM`, etc.) if it exited due to signal `TERM`, etc.) if it exited due to signal
+39 -25
View File
@@ -175,13 +175,13 @@ task [s] echo "foo" | cat >/tmp/bar
.Ed .Ed
.It Cm sysv Oo LVLS Oc Ao COND Ac Ar /path/to/script ARGS Op -- Optional description .It Cm sysv Oo LVLS Oc Ao COND Ac Ar /path/to/script ARGS Op -- Optional description
Similar to Similar to
.Cm task .Cm service
is the is the
.Cm sysv .Cm sysv
stanza, which can be used to call SysV style start/stop scripts. The stanza, which can be used to call SysV style start/stop scripts. The
primary intention for this command is to be able to re-use much of primary intention for this command is to be able to re-use traditional
existing setup and init scripts in Linux distributions. SysV init scripts in Linux distributions.
.Pp .Pp
When entering an allowed runlevel, Finit calls When entering an allowed runlevel, Finit calls
.Cm init-script start , .Cm init-script start ,
when entering a disallowed runlevel, Finit calls when entering a disallowed runlevel, Finit calls
@@ -434,30 +434,42 @@ e.g.,
.Cm kill:10 .Cm kill:10
to wait 10 seconds before sending SIGKILL. to wait 10 seconds before sending SIGKILL.
.Pp .Pp
Services support the Services, including the
.Cm pre:script .Cm sysv
and variant, support pre/post/ready and cleanup scripts:
.Cm post:script .Bl -tag -width 1n
command actions as well. These run as the same .It Cm pre:[0-3600,]script
called before the sysv/service is stated
.It Cm post:[0-3600,]script
called after the sysv/service has stopped
.It Cm ready:[0-3600,]script
called when the sysv/service is ready
.It Cm cleanup:[0-3600,]script
called when run/task/sysv/service is removed
.El
.Pp
The optional number (0-3600) is the timeout before Finit kills the
script, it defaults to the kill delay value and can be disabled by
setting it to zero. These scripts run as the same
.Cm @USER:GROUP .Cm @USER:GROUP
as the service itself, with any as the service itself, with any
.Cm env:file .Cm env:file
sourced. The scripts must use an absolute path, but are executed from sourced. The scripts must use an absolute path, but are executed from
the the
.Cm $HOME .Cm $HOME
of the given user. The scripts are not called with any argument of the given user. The scripts are not called with any argument, but
(currently), but both get the both get a set of environment variables:
.Cm SERVICE_IDENT=foo .Pp
environment variable set. Here .Bl -tag -width 1n -compact
.Cm foo .It Cm SERVICE_IDENT=foo:1
denotes the identity of the service, which if there are multiple .It Cm SERVICE_NAME=foo
services named .It Cm SERVICE_ID=1
.Cm foo , .El
may be .Pp
.Cm foo:1 , The
or any unique identifier specified in the .conf file. The
.Cm post:script .Cm post:script
is called with an additional set of environment variables: is called with an additional set of environment variables, and yes the
naming looks like it should be swapped:
.Bl -tag -offset indent -width 1n .Bl -tag -offset indent -width 1n
.It Cm EXIT_CODE=[exited,signal,crashed] .It Cm EXIT_CODE=[exited,signal,crashed]
set to one of set to one of
@@ -471,10 +483,12 @@ set to one of exit status code from the program, if it exited normally,
or the signal name (HUP, TERM, etc.) if it exited due to signal or the signal name (HUP, TERM, etc.) if it exited due to signal
.El .El
.Pp .Pp
The scripts have a default execution time of 3 seconds before they are When a run/task/sys/service is removed (disable + reload) it is first
SIGKILLed, this can be adjusted using the stopped and then removed from the runlevel. The
.Cm kill:SEC .Cm post:script
modifier syntax. always runs when the process has stopped, and the
.Cm cleanup:script
runs when the the stanza has been removed from the runlevel.
.It Cm runparts Aq DIR .It Cm runparts Aq DIR
Call Call
.Xr run-parts 8 .Xr run-parts 8