svc

Unnamed repository; edit this file 'description' to name the repository.
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување e5c729284b6f38460b05d2bfd90d4206dbb19f5c
родитељ 8d0200981789ce32c33b866a9d2ebb82d56b8699
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Fri, 22 Jul 2022 09:51:33 +0200

Add 1-ST; fix bug with -e in bare.sh

Signed-off-by: Страхиња Радић <contact@strahinja.org>

Diffstat:
Mbin/service | 2++
Mman/man8/service.8 | 23+++++++++++++++++++++++
Msvc.d/bare.sh | 4+++-
измењених датотека: 3, додавања: 28(+), брисања: 1(-)

diff --git a/bin/service b/bin/service @@ -122,6 +122,8 @@ doservice() fi;; 1) if [ "${stop}" -eq 1 ]; then printf "${green}(NOTR)${norm}\n" + elif [ "${exists}" -eq 1 ]; then + printf "${green}(${gray}1-ST${norm}${green})${norm}\n" else printf "${green}(RNNG)${norm}\n" fi diff --git a/man/man8/service.8 b/man/man8/service.8 @@ -67,6 +67,29 @@ service configuration files. .It Pa /bin/svc.d/run symlinks to activated service scripts. .El +.Sh STATUS ABBREVIATIONS +When outputting service status, various four-letter-maximum abbreviations will +be printed on the right: +.Bl -tag -offset indent +.It OK +the operation was successful. +.It FAIL +the operation has failed. +.It YE +the service is running. +.It NO +the service isn't running. +.It 1-ST +the service is +.Dq one-shot , +so the +.Cm exists +operation doesn't apply. +.It RNNG +the service is already running. +.It NOTR +the service already isn't running. +.El .Sh EXIT STATUS .Xr svc 8 , .Nm diff --git a/svc.d/bare.sh b/svc.d/bare.sh @@ -29,7 +29,9 @@ done PID=$(pidof -o %PPID ${BIN}) case $1 in - -e) [ -z "${PID}" ] && exit 2;; + -e) if [ -z "${PID}" ]; then + exit 2 + fi;; -s) $0 "${SERVICE}" -e case $? in 0) return 1;;