updated: sats-debug@.service (according to example) + updated: sats.sysd (to take services from files + instances)

This commit is contained in:
xdrm-brackets 2018-01-29 18:49:34 +01:00
parent 6c5f9c20e0
commit b17e11137a
2 changed files with 10 additions and 10 deletions

View File

@ -2,13 +2,10 @@
Description=[::SATS::] Debugger (to %i) Description=[::SATS::] Debugger (to %i)
[Service] [Service]
Type=simple Type=oneshot
Restart=always
User=pi User=pi
Group=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/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
ExecStart=/bin/bash /home/pi/debug/sats/main %i ExecStart=/bin/bash /home/pi/debug/sats/main %i
ExecStop=/bin/sleep 10 ExecStop=/bin/sleep 10

View File

@ -17,23 +17,26 @@ source $ROOT/com/config/sats;
# (2) Start daemon # (2) Start daemon
#--------------------------------------------------------# #--------------------------------------------------------#
SERV_LIST="`systemctl list-units --plain | grep 'sats' | grep -v '.slice' | awk '{print $1}'`"; 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 while sleep 1; do
for serv in $SERV_LIST; 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 if [ "$status" = "failed" ]; then
echo "SYSD0$serv" >> $BUF_OUT; echo "SYSD0$serv_name" >> $BUF_OUT;
elif [ "$status" = "inactive" ]; then elif [ "$status" = "inactive" ]; then
echo "SYSD1$serv" >> $BUF_OUT; echo "SYSD1$serv_name" >> $BUF_OUT;
elif [ "$status" = "activating" ]; then elif [ "$status" = "activating" ]; then
echo "SYSD2$serv" >> $BUF_OUT; echo "SYSD2$serv_name" >> $BUF_OUT;
elif [ "$status" = "active" ]; then elif [ "$status" = "active" ]; then
echo "SYSD3$serv" >> $BUF_OUT; echo "SYSD3$serv_name" >> $BUF_OUT;
fi; fi;