-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathsystemd-slave
18 lines (16 loc) · 1.02 KB
/
systemd-slave
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[Unit]
Description=Smokeping Service, Network Latency Graphical Viewer
After=network.service smokeping-master.service nginx.service
[Service]
Type=forking
Environment=MASTER=127.0.0.1
Environment=CACHEDIR=/usr/local/smokeping/cache
Environment=SECRET=/usr/local/smokeping/etc/secrets
Environment=NAME=SLAVE_CODE
ExecStartPre=/bin/sh -c "/usr/bin/nc -zv -w 5 ${MASTER} port1 &> /dev/null && echo 'Smokeping Master Accepts connections...'"
ExecStartPre=/bin/echo "/usr/local/smokeping/bin/smokeping --master-url=http://${MASTER}:port1/ --cache-dir=${CACHEDIR} --slave-name=${NAME} --shared-secret=${SECRET} --debug-daemon"
ExecStart=/bin/sh -c "/usr/local/smokeping/bin/smokeping --master-url=http://${MASTER}:port1/ --cache-dir=${CACHEDIR} --slave-name=${NAME} --shared-secret=${SECRET} --debug-daemon"
KillSignal=SIGTERM
ExecReload=/bin/sh -c "/usr/local/smokeping/bin/smokeping --master-url=http://${MASTER}:port1/ --cache-dir=${CACHEDIR} --slave-name=${NAME} --shared-secret=${SECRET} --debug-daemon --reload"
[Install]
WantedBy=default.target