updated: sats-debug@.service (according to example) + updated: sats.sysd (to take services from files + instances)
This commit is contained in:
parent
6c5f9c20e0
commit
b17e11137a
|
@ -2,13 +2,10 @@
|
|||
Description=[::SATS::] Debugger (to %i)
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
Type=oneshot
|
||||
User=pi
|
||||
Group=pi
|
||||
ExecStartPre=/usr/bin/sudo -u sats git clone --recursive -b master ssh://smmp-server/satsd/debug /home/pi/debug
|
||||
ExecStartPre=/usr/bin/sudo chown -R pi:pi /home/pi/debug
|
||||
ExecStartPre=/usr/bin/sudo chmod -R 750 /home/pi/debug
|
||||
ExecStartPre=-/usr/bin/git clone --recursive -b master ssh://smmp-server/satsd/debug /home/pi/debug
|
||||
ExecStart=/bin/bash /home/pi/debug/sats/main %i
|
||||
ExecStop=/bin/sleep 10
|
||||
|
||||
|
|
13
sats/sysd
13
sats/sysd
|
@ -17,23 +17,26 @@ source $ROOT/com/config/sats;
|
|||
# (2) Start daemon
|
||||
#--------------------------------------------------------#
|
||||
SERV_LIST="`systemctl list-units --plain | grep 'sats' | grep -v '.slice' | awk '{print $1}'`";
|
||||
SERV_LIST="`ls -l /lib/systemd/system/sats-* | grep -vP '~$' | grep -vP '@.service$' | awk '{print $NF}'`$SERVLIST";
|
||||
|
||||
while sleep 1; do
|
||||
|
||||
for serv in $SERV_LIST; do
|
||||
|
||||
status="`systemctl is-active $(basename $serv)`";
|
||||
serv_name=`basename $serv`;
|
||||
status="`systemctl is-active $serv_name`";
|
||||
|
||||
if [ "$status" = "failed" ]; then
|
||||
echo "SYSD0$serv" >> $BUF_OUT;
|
||||
echo "SYSD0$serv_name" >> $BUF_OUT;
|
||||
|
||||
elif [ "$status" = "inactive" ]; then
|
||||
echo "SYSD1$serv" >> $BUF_OUT;
|
||||
echo "SYSD1$serv_name" >> $BUF_OUT;
|
||||
|
||||
elif [ "$status" = "activating" ]; then
|
||||
echo "SYSD2$serv" >> $BUF_OUT;
|
||||
echo "SYSD2$serv_name" >> $BUF_OUT;
|
||||
|
||||
elif [ "$status" = "active" ]; then
|
||||
echo "SYSD3$serv" >> $BUF_OUT;
|
||||
echo "SYSD3$serv_name" >> $BUF_OUT;
|
||||
|
||||
fi;
|
||||
|
||||
|
|
Loading…
Reference in New Issue