[UPDATE] - init.d

This commit is contained in:
Prof Isen 2022-05-02 23:11:22 +02:00
parent 86011bbacf
commit 5718426164
4 changed files with 19 additions and 8 deletions

View File

@ -1,5 +1,5 @@
---
title: monithor-server
title: monithor-client
section: 1
author: Guillaume Astier Ruiz
date: 20220320

View File

@ -7,9 +7,9 @@ date: 20220320
# SYNOPSIS
`/usr/local/bin/monithor-server [start/stop]`
`/usr/local/bin/monithor-d [start/stop]`
`/etc/init.d/monithor-c [start/stop]`
`/etc/init.d/monithor-d [start/stop]`
# DESCRIPTION
@ -26,11 +26,11 @@ le service peut être démarré et arrêté via system V
- Démarrage
`/etc/init.d/monithor-c start`
`/etc/init.d/monithor-d start`
- Arrêt
`/etc/init.d/monithor-c start`
`/etc/init.d/monithor-d start`
# CONFIGURATION SERVICE

View File

@ -4,7 +4,7 @@
# Provides: monithor-c
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: MoniThor Server
# Short-Description: MoniThor client
### END INIT INFO
set -e
@ -21,15 +21,20 @@ case "$1" in
logger "monithor-client is running ..."
exit
else
logger "Starting MoniThor Server"
logger "Starting MoniThor client "
/usr/local/bin/monithor-client start
fi
;;
stop)
logger "Stoping MoniThor server" "monithor-c" || true
logger "Stoping MoniThor client " "monithor-c" || true
/usr/local/bin/monithor-client stop
;;
status)
logger "status MoniThor client " "monithor-c" || true
[ $(ps axf| grep MoniThor | grep SCREEN | wc -l) -gt 1 ] && echo "monithor-c is running" || echo "montihor-c is dead"
;;
*)
echo "Usage: /etc/init.d/monithor-c {start|stop|status}" || true
exit 1

View File

@ -30,6 +30,12 @@ case "$1" in
/usr/local/bin/monithor-server stop
;;
status)
logger "status MoniThor server" "monithor-d" || true
[ $(ps axf| grep /usr/local/bin/monithor-server|grep -v grep) ] && echo "monithor-d is running" || echo "montihor-d is dead"
;;
*)
echo "Usage: /etc/init.d/monithor-d {start|stop|status}" || true
exit 1