-
Notifications
You must be signed in to change notification settings - Fork 3
/
indep_node_alarm_service.sh
32 lines (30 loc) · 1.09 KB
/
indep_node_alarm_service.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
cd /home/ubuntu/indep_node_alarm;echo "[Unit]
Description=indep_node_alarm
After=network-online.target
[Service]
User=ubuntu
WorkingDirectory=/home/ubuntu/indep_node_alarm
ExecStart=/usr/bin/python3 /home/ubuntu/indep_node_alarm/indep_node_alarm.py
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=indep_node_alarm
Restart=always
RestartSec=200
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target" > indep_node_alarm.service;sudo mv indep_node_alarm.service /etc/systemd/system/;sudo systemctl enable indep_node_alarm.service
cd /home/ubuntu/indep_node_alarm;echo "[Unit]
Description=indep_node_alarm_check
After=network-online.target
[Service]
User=ubuntu
WorkingDirectory=/home/ubuntu/indep_node_alarm
ExecStart=/usr/bin/python3 /home/ubuntu/indep_node_alarm/indep_node_alarm_check.py
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=indep_node_alarm_check
Restart=always
RestartSec=200
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target" > indep_node_alarm_check.service;sudo mv indep_node_alarm_check.service /etc/systemd/system/;sudo systemctl enable indep_node_alarm_check.service