-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (34 loc) · 1.27 KB
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
38
# Copy in /usr/lib/systemd/system or https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html#Unit%20File%20Load%20Path
# Enable with
# systemctl enable [email protected]; systemctl start [email protected]
# systemctl enable [email protected]; systemctl start [email protected]
[Unit]
Description=Renderme - Lsyncd daemon %I
After=network-online.target local-fs.target
Requires=network-online.target local-fs.target
StartLimitIntervalSec=60
StartLimitBurst=4
[Service]
#ExecStartPre=/bin/sleep 30
#Simple means lsyncd process will stay in the foreground and will not fork.
Type=simple
#Restart the service no matter how it stopped.
Restart=always
#Lowest priority
Nice=19
#Change the working directory so the "require" function of lua will find the config file
WorkingDirectory=/home/rickyx/Documents/Renderme
#Nodaemon prevents lsyncd from daemonizing, use with simple type
ExecStart=/usr/local/bin/lsyncd -nodaemon /etc/lsyncd/%i.lua
#Reload its configuration files without restarting the process entirely
ExecReload=/bin/kill -HUP $MAINPID
PIDFile=/run/lsyncd%i.pid
RestartSec=2
# Hardening
ProtectSystem=full
PrivateTmp=true
SystemCallArchitectures=native
MemoryDenyWriteExecute=true
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target