sysmgr

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

commit f3c991b56d3c59db7caff0cc1cf69726df941a11
parent b1f3036f1fd438648cf1dce35723da556a21137b
Author: Cem Keylan <cem@ckyln.com>
Date:   Wed, 26 Feb 2020 09:44:41 +0300

svctl: add new functions

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

diff --git a/sysmgr b/sysmgr @@ -184,13 +184,18 @@ fn_svctl() { printf '9\n' > "${RUNDIR:?}/$2/lock" kill -9 "$(cat "${RUNDIR:?}/$2/pid")" 2>/dev/null ;; - stop) + down|stop) printf '15\n' > "${RUNDIR:?}/$2/lock" kill -15 "$(cat "${RUNDIR:?}/$2/pid")" 2>/dev/null ;; - start) + up|start) rm -rf "${RUNDIR:?}/${2}" ;; + once) + fn_svctl start "$2" + sleep 1 # Wait for the service to go up + printf 'once\n' > "${RUNDIR:?}/$2/lock" + ;; *) exit 1 ;;