added logging to syslog

This commit is contained in:
root 2016-02-04 16:53:15 +01:00
parent f88c3267d4
commit 2a3c9f52dc
1 changed files with 16 additions and 4 deletions

View File

@ -1,9 +1,21 @@
#!/bin/sh
#!/bin/bash
cd $(dirname $0)
while /bin/true;
PIDS=""
for i in $(ps -awx | grep -i [c]loudbot | sed "s/^\s*//" | cut -d" " -f1); do
if [ $i != $$ ]; then
PIDS="$i $PIDS"
fi
done
if [ ! -z "$PIDS" ]; then
kill $PIDS
sleep 10
kill -9 $PIDS >/dev/null 2>&1
fi
while true
do
sudo -u cloudbot ./cloudbot.py
sudo -u cloudbot ./cloudbot.py 2>&1 | logger -s -t $(basename $0)
sleep 10
done