svc

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

чување 1b6db2e47d35f67db3d659b90887088b5d0ffec5
родитељ 31f3223b508d54786b6b86ab98de72dd086590c7
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Mon, 18 Jul 2022 14:49:03 +0200

Account for forking services (fallback to pidof)

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

Diffstat:
Msvc.d/bare.sh | 5++---
измењених датотека: 1, додавања: 2(+), брисања: 3(-)

diff --git a/svc.d/bare.sh b/svc.d/bare.sh @@ -33,8 +33,7 @@ case $1 in exit 0;; -s) if [ -z "${PID}" ]; then ${BIN} ${PARAMS} & - if ! ps -ef | awk '{print $2}' | grep $! \ - >/dev/null 2>&1; then + if ! pidof -o %PPID "${BIN}" >/dev/null 2>&1; then exit 2 fi exit 0 @@ -61,7 +60,7 @@ case $1 in fi fi ${BIN} ${PARAMS} & - if ! ps -ef | awk '{print $2}' | grep $! >/dev/null 2>&1; then + if ! pidof -o %PPID "${BIN}" >/dev/null 2>&1; then exit 2 fi exit 0;;