forked from dsmrreader/dsmr-reader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reload.sh
executable file
·36 lines (28 loc) · 1.15 KB
/
reload.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
# Sending a HANGUP signal to Gunicorn's master process will gracefully reload its children.
echo ""
printf "%-50s" " * Reloading process: dsmr_webinterface (Gunicorn)"
if [ -f /var/tmp/gunicorn--dsmr_webinterface.pid ];
then
cat /var/tmp/gunicorn--dsmr_webinterface.pid | xargs kill -HUP
echo " [OK]"
else
echo " [!!] PID file does not exist (as sudo user, try 'sudo supervisorctl start dsmr_webinterface')"
fi
# Management commands have some builtin mechanism for this as well.
printf "%-50s" " * Reloading process: dsmr_backend"
if [ -f /var/tmp/dsmrreader--dsmr_backend.pid ];
then
cat /var/tmp/dsmrreader--dsmr_backend.pid | xargs kill -HUP
echo " [OK]"
else
echo " [!!] PID file does not exist (as sudo user, try 'sudo supervisorctl start dsmr_backend')"
fi
printf "%-50s" " * Reloading process: dsmr_datalogger"
if [ -f /var/tmp/dsmrreader--dsmr_datalogger.pid ];
then
cat /var/tmp/dsmrreader--dsmr_datalogger.pid | xargs kill -HUP
echo " [OK]"
else
echo " [!!] PID file does not exist or the datalogger is disabled (Should it run? As sudo user, try 'sudo supervisorctl start dsmr_datalogger')"
fi