Skip to content

Instantly share code, notes, and snippets.

@luminoso
Created May 30, 2020 21:37
Show Gist options
  • Save luminoso/9db62a18eaf6ec817e9901f8b86c9ca0 to your computer and use it in GitHub Desktop.
Save luminoso/9db62a18eaf6ec817e9901f8b86c9ca0 to your computer and use it in GitHub Desktop.
systemd unit sample
$ cat /etc/systemd/system/example.service
[Unit]
Description=basic service
[Service]
Type=notify
ExecStart=/bin/bash /usr/bin/true
Restart=on-failure
NoNewPrivileges=yes
NotifyAccess=yes
PrivateDevices=yes
PrivateMounts=yes
PrivateTmp=yes
PrivateUsers=yes
ProtectClock=yes
ProtectControlGroups=yes
ProtectHome=yes
ProtectKernelLogs=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
ProtectSystem=strict
CapabilityBoundingSet=
NoNewPrivileges=yes
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
LimitNOFILE=infinity
ProtectHostname=yes
SystemCallArchitectures=native
DynamicUser=yes
MemoryDenyWriteExecute=yes
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment