Skip to content

Commit a998c26

Browse files
author
duanhongyi
committed
add systemd
1 parent 56f8ced commit a998c26

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[Unit]
2+
Description=parkingcam-ms daemon
3+
Wants=res.service
4+
After=network.target
5+
6+
[Service]
7+
User=root
8+
Group=root
9+
WorkingDirectory={smartdns_path}
10+
ExecStart=/bin/sh run_dns.sh
11+
ExecReload=/bin/kill -s HUP $MAINPID
12+
ExecStop=/bin/kill -s TERM $MAINPID
13+
EnvironmentFile=/etc/environment
14+
PrivateTmp=true
15+
Restart=on-failure
16+
RestartSec=2s
17+
18+
[Install]
19+
WantedBy=multi-user.target

script/dns_in_twisted.py

100644100755
File mode changed.

script/install_smartdns.sh

100644100755
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@ fi
2929
dnsfile=`find $filepath/../../smartdns_env/lib/python*/site-packages/Twisted-12.2.0*/twisted/names -name dns.py`
3030
cp -f $filepath/dns_in_twisted.py $dnsfile
3131

32+
cp -rf $filepath/../rootfs/* /
33+
sed -i "s#{smartdns_path}#${filepath}#g" /etc/systemd/system/smartdns.service
34+
systemctl daemon-reload
35+
systemctl enable smartdns
36+
systemctl start smartdns

0 commit comments

Comments
 (0)