2025-03-11 06:57:02 +03:00
|
|
|
# Example systemd service unit for nfqws. Adjust for your installation.
|
|
|
|
|
2025-03-12 12:58:36 +03:00
|
|
|
# WARNING ! This unit requires to compile nfqws using `make systemd`
|
|
|
|
# WARNING ! This makefile target enabled special systemd notify support.
|
|
|
|
|
2025-03-12 17:20:52 +03:00
|
|
|
# PREPARE
|
|
|
|
# install build depends
|
|
|
|
# make -C /opt/zapret systemd
|
|
|
|
# cp nfqws@service /lib/systemd/system
|
2025-03-12 17:47:17 +03:00
|
|
|
# systemctl daemon-reload
|
2025-03-12 17:20:52 +03:00
|
|
|
|
|
|
|
# MANAGE INSTANCE
|
|
|
|
# prepare /etc/zapret/nfqws1.conf with nfqws parameters
|
|
|
|
# systemctl start nfqws@nfqws1
|
|
|
|
# systemctl status nfqws@nfqws1
|
|
|
|
# systemctl restart nfqws@nfqws1
|
|
|
|
# systemctl enable nfqws@nfqws1
|
|
|
|
# systemctl disable nfqws@nfqws1
|
|
|
|
# systemctl stop nfqws@nfqws1
|
|
|
|
|
|
|
|
# DELETE
|
|
|
|
# rm /lib/systemd/system/nfqws@.service
|
|
|
|
# systemctl daemon-reload
|
|
|
|
|
|
|
|
|
2025-03-11 06:57:02 +03:00
|
|
|
[Unit]
|
|
|
|
After=network.target
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=notify
|
|
|
|
Restart=on-failure
|
|
|
|
|
|
|
|
ExecSearchPath=/opt/zapret/binaries/my
|
2025-03-12 17:20:52 +03:00
|
|
|
ExecStart=nfqws @${CONFIG_DIR}/${INSTANCE}.conf
|
|
|
|
Environment=CONFIG_DIR=/etc/zapret
|
|
|
|
Environment=INSTANCE=%i
|
2025-03-11 06:57:02 +03:00
|
|
|
|
|
|
|
RestrictAddressFamilies=AF_NETLINK AF_UNIX AF_INET6 AF_INET
|
|
|
|
|
|
|
|
LockPersonality=true
|
|
|
|
MemoryDenyWriteExecute=true
|
|
|
|
PrivateDevices=true
|
|
|
|
PrivateMounts=true
|
|
|
|
PrivateTmp=true
|
|
|
|
ProcSubset=pid
|
|
|
|
ProtectClock=true
|
|
|
|
ProtectControlGroups=true
|
|
|
|
ProtectHome=true
|
|
|
|
ProtectHostname=true
|
|
|
|
ProtectKernelLogs=true
|
|
|
|
ProtectKernelModules=true
|
|
|
|
ProtectKernelTunables=true
|
|
|
|
ProtectProc=invisible
|
2025-03-12 17:20:52 +03:00
|
|
|
ProtectSystem=full
|
2025-03-11 06:57:02 +03:00
|
|
|
RemoveIPC=true
|
|
|
|
RestrictNamespaces=true
|
|
|
|
RestrictRealtime=true
|
|
|
|
RestrictSUIDSGID=true
|
|
|
|
SystemCallArchitectures=native
|
|
|
|
SystemCallFilter=@system-service
|
2025-03-12 17:20:52 +03:00
|
|
|
SystemCallFilter=~@resources
|
2025-03-11 06:57:02 +03:00
|
|
|
UMask=0077
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|