-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlamp.service
37 lines (28 loc) · 1.04 KB
/
lamp.service
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
32
33
34
35
36
37
# systemd unit file
[Unit]
# Human readable name of the unit. Updated in override file
Description=pyService
After=multi-user.target
[Service]
# Command to execute when the service is started. Added in override file
# ExecStart=/usr/bin/python3 /home/nick/projects/lamp/lamp.py
# Disable Python's buffering of STDOUT and STDERR, so that output from the
# service shows up immediately in systemd's logs
Environment=PYTHONUNBUFFERED=1
# Automatically restart the service if it crashes
Restart=on-failure
#Restart=no
WatchdogSec=30s
# "Units which are started more than burst times within an interval time interval are not permitted to start any more." ~systemd.unit doc
StartLimitInterval=5min
StartLimitBurst=5
StartLimitAction=none
# Our service will notify systemd once it is up and running
Type=notify
# Use a dedicated user to run our service. Added in override file
User=None
[Install]
# Tell systemd to automatically start this service when the system boots
# (assuming the service is enabled)
#WantedBy=default.target
WantedBy=multi-user.target