Fix in pzoo stats
This commit is contained in:
parent
71ad1d0fff
commit
8ca683bdc1
1 changed files with 18 additions and 1 deletions
|
|
@ -181,7 +181,24 @@ if check_url.match(args.url_stats):
|
||||||
|
|
||||||
systemd_unit=systemd_unit.replace('pzoo', args.user)
|
systemd_unit=systemd_unit.replace('pzoo', args.user)
|
||||||
|
|
||||||
f.write(systemd_unit)
|
#f.write(systemd_unit)
|
||||||
|
f.write('# Save it in /etc/systemd/system/pastafaristats.service\n')
|
||||||
|
f.write('[Unit]\n')
|
||||||
|
f.write('Description=Pastafari Stats\n')
|
||||||
|
f.write('After=syslog.target\n')
|
||||||
|
f.write('After=network.target\n\n')
|
||||||
|
|
||||||
|
f.write('[Service]\n')
|
||||||
|
f.write('Type=simple\n')
|
||||||
|
f.write('User=pzoo\n'.replace('pzoo', args.user))
|
||||||
|
f.write('Group=pzoo\n'.replace('pzoo', args.user))
|
||||||
|
f.write('ExecStart=/opt/pythonenv/bin/pastafaristats\n')
|
||||||
|
f.write('Restart=always\n')
|
||||||
|
f.write('Environment=PYTHONUNBUFFERED=1\n\n')
|
||||||
|
|
||||||
|
f.write('[Install]\n')
|
||||||
|
f.write('WantedBy=multi-user.target\n')
|
||||||
|
|
||||||
|
|
||||||
if call("sudo systemctl enable pastafaristats.service && sudo systemctl start pastafaristats.service", shell=True)>0:
|
if call("sudo systemctl enable pastafaristats.service && sudo systemctl start pastafaristats.service", shell=True)>0:
|
||||||
print('Error, cannot start pastafari stats')
|
print('Error, cannot start pastafari stats')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue