-
Notifications
You must be signed in to change notification settings - Fork 1
/
daemon_start
executable file
·21 lines (19 loc) · 923 Bytes
/
daemon_start
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
#
# This script starts the Synda (sdt) daemon, if it had died.
# Then it stops the daemon to get some cleanup (which is occasionally necessary to prevent stalls).
# Then it starts the daemon again.
# This script is suitable for being called by cron.
# The use of systemctl works for Red Hat 7, not Red Hat 6.
source /home/painter/.bash_profile
if pgrep -f sddaemon > /dev/null 2>&1
then
#echo `date` ok >> /var/log/synda/daemon/daemon_start.log 2>&1
# The "ok" logging isn't needed now that I know that this is working. Use a no-op instead:
:
else
echo `date` starting daemon >> /var/log/synda/daemon/daemon_start.log 2>&1
sudo /usr/bin/systemctl start synda >> /var/log/synda/daemon/daemon_start.log 2>&1
sudo /usr/bin/systemctl stop synda >> /var/log/synda/daemon/daemon_start.log 2>&1
sudo /usr/bin/systemctl start synda >> /var/log/synda/daemon/daemon_start.log 2>&1
fi