dot

packages and services management
Log | Files | Refs | README

commit db0b17a6dfc4ed130d6bc7a4402ce0d89049e64d
parent 30d2bb8505b0ea836424636d701f2b0afce56fdf
Author: Josuah Demangeon <josuah.demangeon@gandi.net>
Date:   Mon, 19 Jun 2017 22:47:56 +0200

multiple pid per file

Diffstat:
MSERVICE | 13++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/SERVICE b/SERVICE @@ -33,7 +33,7 @@ start() status "$service" && return 1 - . "$ETC/$service/start" "$@" > "$VAR/log/$service" 2>&1 + sh "$ETC/$service/start" "$@" > "$VAR/log/$service" 2>&1 && printf %s $! > "$VAR/pid/$service" status "$service" @@ -44,12 +44,11 @@ stop() { status "$1" || return 1 - read pid < "$VAR/pid/$1" - - if [ -f "$ETC/$1/stop" ] - then sh "$ETC/$2/stop" - else kill -14 "$pid" - fi && rm "$VAR/pid/$1" + while read pid arguments + do + tr '\0' ' ' | grep -F "$*" && + kill -14 "$pid" && rm "$VAR/pid/$1" + done status "$1" && return 1 || return 0 }