2017-09-05 11:47:31 -04:00
|
|
|
[Unit]
|
|
|
|
Description=Small description of the service
|
|
|
|
After=network.target
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=simple
|
|
|
|
User=__APP__
|
|
|
|
Group=__APP__
|
|
|
|
WorkingDirectory=__FINALPATH__/
|
|
|
|
ExecStart=__FINALPATH__/script >> /var/log/__APP__/__APP__.log 2>&1
|
|
|
|
|
2020-11-11 10:02:30 -05:00
|
|
|
# Sandboxing options to harden security
|
|
|
|
# Depending on specificities of your service/app, you may need to tweak these
|
|
|
|
# .. but this should be a good baseline
|
|
|
|
# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html
|
|
|
|
NoNewPrivileges=yes
|
|
|
|
PrivateTmp=yes
|
|
|
|
PrivateDevices=yes
|
|
|
|
DevicePolicy=closed
|
|
|
|
ProtectSystem=full
|
|
|
|
ProtectControlGroups=yes
|
|
|
|
ProtectKernelModules=yes
|
|
|
|
ProtectKernelTunables=yes
|
|
|
|
RestrictRealtime=yes
|
|
|
|
RestrictSUIDSGID=yes
|
|
|
|
MemoryDenyWriteExecute=yes
|
|
|
|
LockPersonality=yes
|
|
|
|
|
2017-09-05 11:47:31 -04:00
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|