mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
pservice: initial version
The can be convenient for running commands or services as procd services without needing to separately write initscripts, just uci configuration. The package was imported from [1]. [1] https://github.com/yousong/waller/tree/0a85f5c75fb70627f68cbbcab4807e02e3299e2e/pservice Ref: https://github.com/yousong/waller/issues/1 Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
# uci
|
||||
|
||||
`disabled`, bool, default `0`
|
||||
|
||||
`name`, string, name of the service instance
|
||||
|
||||
`command`, file, the service instance executable
|
||||
|
||||
`args`, list of args
|
||||
|
||||
`stderr`, bool, default `0`, log stderr output of the service instance
|
||||
|
||||
`stdout`, bool, default `0`, log stdout output of the service instance
|
||||
|
||||
`env`, list of environment variable settings of the form `var=val`
|
||||
|
||||
`file`, list of file names. Service instances will be restarted if content of
|
||||
these files have changed on service reload event.
|
||||
|
||||
`respawn_threshold`, uinteger, default `3600`, time in seconds the instances
|
||||
have to be in running state to be considered a valid run
|
||||
|
||||
`respawn_timeout`, uinteger, default `5`, time in seconds the instance should
|
||||
be delayed to start again after the last crash
|
||||
|
||||
`respawn_maxfail`, uinteger, default `5`, maximum times the instances can
|
||||
crash/fail in a row and procd will not try to bring it up again after this
|
||||
limit has been reached
|
||||
|
||||
# notes and faq
|
||||
|
||||
Initial environment variables presented to service instances may be different
|
||||
from what was observed on the interactive terminal. E.g. `HOME=/` may affect
|
||||
reading `~/.ssh/known_hosts` of dropbear ssh instance.
|
||||
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin PWD=/ HOME=/
|
||||
|
||||
If `list args xxx` seems to be too long causing pain, consider using `/bin/sh`
|
||||
as the `command`. It is also worth noting that uci supports multi-line option
|
||||
value.
|
||||
|
||||
Child processes will keep running when their parent process was killed. This
|
||||
is especially the case and should be taken into account with option `command`
|
||||
being `/bin/sh` and it is recommended to use `exec` as the last shell command.
|
||||
Reference in New Issue
Block a user