forked from netbirdio/netbird
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add systemd .service files (netbirdio#1316) (netbirdio#1318)
Add systemd .service files
- Loading branch information
Showing
4 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Extra flags you might want to pass to the daemon | ||
FLAGS="" | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[Unit] | ||
Description=Netbird Management | ||
Documentation=https://netbird.io/docs | ||
After=network-online.target syslog.target | ||
Wants=network-online.target | ||
|
||
[Service] | ||
Type=simple | ||
EnvironmentFile=-/etc/default/netbird-management | ||
ExecStart=/usr/bin/netbird-mgmt management $FLAGS | ||
Restart=on-failure | ||
RestartSec=5 | ||
TimeoutStopSec=10 | ||
CacheDirectory=netbird | ||
ConfigurationDirectory=netbird | ||
LogDirectory=netbird | ||
RuntimeDirectory=netbird | ||
StateDirectory=netbird | ||
|
||
# sandboxing | ||
LockPersonality=yes | ||
MemoryDenyWriteExecute=yes | ||
NoNewPrivileges=yes | ||
PrivateMounts=yes | ||
PrivateTmp=yes | ||
ProtectClock=yes | ||
ProtectControlGroups=yes | ||
ProtectHome=yes | ||
ProtectHostname=yes | ||
ProtectKernelLogs=yes | ||
ProtectKernelModules=yes | ||
ProtectKernelTunables=yes | ||
ProtectSystem=yes | ||
RemoveIPC=yes | ||
RestrictNamespaces=yes | ||
RestrictRealtime=yes | ||
RestrictSUIDSGID=yes | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[Unit] | ||
Description=Netbird Signal | ||
Documentation=https://netbird.io/docs | ||
After=network-online.target syslog.target | ||
Wants=network-online.target | ||
|
||
[Service] | ||
Type=simple | ||
EnvironmentFile=-/etc/default/netbird-signal | ||
ExecStart=/usr/bin/netbird-signal run $FLAGS | ||
Restart=on-failure | ||
RestartSec=5 | ||
TimeoutStopSec=10 | ||
CacheDirectory=netbird | ||
ConfigurationDirectory=netbird | ||
LogDirectory=netbird | ||
RuntimeDirectory=netbird | ||
StateDirectory=netbird | ||
|
||
# sandboxing | ||
LockPersonality=yes | ||
MemoryDenyWriteExecute=yes | ||
NoNewPrivileges=yes | ||
PrivateMounts=yes | ||
PrivateTmp=yes | ||
ProtectClock=yes | ||
ProtectControlGroups=yes | ||
ProtectHome=yes | ||
ProtectHostname=yes | ||
ProtectKernelLogs=yes | ||
ProtectKernelModules=yes | ||
ProtectKernelTunables=yes | ||
ProtectSystem=yes | ||
RemoveIPC=yes | ||
RestrictNamespaces=yes | ||
RestrictRealtime=yes | ||
RestrictSUIDSGID=yes | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[Unit] | ||
Description=Netbird Client (%i) | ||
Documentation=https://netbird.io/docs | ||
After=network-online.target syslog.target NetworkManager.service | ||
Wants=network-online.target | ||
|
||
[Service] | ||
Type=simple | ||
EnvironmentFile=-/etc/default/netbird | ||
ExecStart=/usr/bin/netbird service run --log-file /var/log/netbird/client-%i.log --config /etc/netbird/%i.json --daemon-addr unix:///var/run/netbird/%i.sock $FLAGS | ||
Restart=on-failure | ||
RestartSec=5 | ||
TimeoutStopSec=10 | ||
CacheDirectory=netbird | ||
ConfigurationDirectory=netbird | ||
LogDirectory=netbird | ||
RuntimeDirectory=netbird | ||
StateDirectory=netbird | ||
|
||
# sandboxing | ||
LockPersonality=yes | ||
MemoryDenyWriteExecute=yes | ||
NoNewPrivileges=yes | ||
PrivateMounts=yes | ||
PrivateTmp=yes | ||
ProtectClock=yes | ||
ProtectControlGroups=yes | ||
ProtectHome=yes | ||
ProtectHostname=yes | ||
ProtectKernelLogs=yes | ||
ProtectKernelModules=no # needed to load wg module for kernel-mode WireGuard | ||
ProtectKernelTunables=no | ||
ProtectSystem=yes | ||
RemoveIPC=yes | ||
RestrictNamespaces=yes | ||
RestrictRealtime=yes | ||
RestrictSUIDSGID=yes | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
|