# Example systemd service unit for tpws. Adjust for your installation. # WARNING ! This unit requires to compile tpws using `make systemd` # WARNING ! This makefile target enabled special systemd notify support. # PREPARE # install build depends # make -C /opt/zapret systemd # cp tpws@service /lib/systemd/system # systemctl daemon-reload # MANAGE INSTANCE # prepare /etc/zapret/tpws1.conf with tpws parameters # systemctl start tpws@tpws1 # systemctl status tpws@tpws1 # systemctl restart tpws@tpws1 # systemctl enable tpws@tpws1 # systemctl disable tpws@tpws1 # systemctl stop tpws@tpws1 # DELETE # rm /lib/systemd/system/tpws@.service # systemctl daemon-reload [Unit] After=network.target [Service] Type=notify Restart=on-failure ExecSearchPath=/opt/zapret/binaries/my ExecStart=tpws @${CONFIG_DIR}/${INSTANCE}.conf Environment=CONFIG_DIR=/etc/zapret Environment=INSTANCE=%i 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 ProtectProc=invisible ProtectSystem=full RemoveIPC=true RestrictNamespaces=true RestrictRealtime=true RestrictSUIDSGID=true SystemCallArchitectures=native SystemCallFilter=@system-service UMask=0077 [Install] WantedBy=multi-user.target