sysmgr

a simplistic service supervisor
git clone git://git.ckyln.com/~cem/sysmgr.git
Log | Files | Refs | README | LICENSE

commit 5f28c9ec3f2293b00536b7d9e94d187ed3aa3242
parent a0a18343948227af751fd73e60130cd869d27851
Author: Cem Keylan <cem@ckyln.com>
Date:   Fri, 31 Jul 2020 19:29:40 +0300

sysmgr: proper in-function variable calls

Diffstat:
Msysmgr | 14+++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/sysmgr b/sysmgr @@ -63,9 +63,9 @@ cleanup() { # Clean the service run directory so that it can be restarted. Do not remove # the run directory if lock file exists. - rm -f "${RUNDIR}/${service##*/}/pid" "${RUNDIR}/${service##*/}/syspid" + rm -f "$RUNDIR/${service##*/}/pid" "${RUNDIR}/${service##*/}/syspid" - [ -e "${RUNDIR:?}/${service##*/}/lock" ] && return + [ -e "$RUNDIR/${service##*/}/lock" ] && return rm -rf "${RUNDIR:?}/${service##*/}" } @@ -95,9 +95,9 @@ getpid() { # This is a function to retrieve the pid from the RUNDIR - [ -f "${RUNDIR:?}/$1/${2:-pid}" ] || + [ -f "$RUNDIR/$1/${2:-pid}" ] || { error "pid file for $1 could not be found" ; return 1 ;} - read -r pid < "${RUNDIR:?}/$1/${2:-pid}" + read -r pid < "$RUNDIR/$1/${2:-pid}" } redirectsignal() { @@ -214,11 +214,11 @@ fn_svctl() { fn_svctl start "$service" ;; kill) - log 9 > "${RUNDIR:?}/$service/lock" + log 9 > "$RUNDIR/$service/lock" kill -9 "$pid" ;; down|stop) - log 15 > "${RUNDIR:?}/$service/lock" + log 15 > "$RUNDIR/$service/lock" kill -15 "$pid" ;; up|start) @@ -228,7 +228,7 @@ fn_svctl() { # attempt to restart it, if it goes down. fn_svctl start "$service" sleep 1 - log once > "${RUNDIR:?}/$service/lock" + log once > "$RUNDIR/$service/lock" ;; *) usage ;; esac