diff options
author | Yousong Zhou <yszhou4tech@gmail.com> | 2019-08-04 15:36:08 +0000 |
---|---|---|
committer | Yousong Zhou <yszhou4tech@gmail.com> | 2019-08-06 10:09:58 +0800 |
commit | d58a81f35cd0187866f8f06b90a375a088181210 (patch) | |
tree | 22e88ed9634906230c24e10933872d2d4f696b9e /utils/pservice/README.md | |
parent | 1a782269f356eeb5d2eceba248f535642b38dc94 (diff) |
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>
Diffstat (limited to 'utils/pservice/README.md')
-rw-r--r-- | utils/pservice/README.md | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/utils/pservice/README.md b/utils/pservice/README.md new file mode 100644 index 000000000..85fbd6c42 --- /dev/null +++ b/utils/pservice/README.md @@ -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. |