Created
May 30, 2020 21:37
-
-
Save luminoso/9db62a18eaf6ec817e9901f8b86c9ca0 to your computer and use it in GitHub Desktop.
systemd unit sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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