File tree Expand file tree Collapse file tree 1 file changed +10
-28
lines changed
Expand file tree Collapse file tree 1 file changed +10
-28
lines changed Original file line number Diff line number Diff line change 4242 after = [ "network-online.target" ] ;
4343 serviceConfig = {
4444 ExecStart = "${ cfg . package } /bin/defguard-service --log-level ${ cfg . logLevel } --stats-period ${ toString cfg . statsPeriod } " ;
45- Restart = "on-failure" ;
46- RestartSec = 5 ;
47- User = "defguard" ;
45+ ExecReload = "/bin/kill -HUP $MAINPID" ;
4846 Group = "defguard" ;
49- StateDirectory = "defguard-service" ;
50- LogsDirectory = "defguard-service" ;
51- # Add capabilities to manage network interfaces
52- CapabilityBoundingSet = "CAP_NET_ADMIN CAP_NET_RAW CAP_SYS_MODULE" ;
53- AmbientCapabilities = "CAP_NET_ADMIN CAP_NET_RAW CAP_SYS_MODULE" ;
54- # Allow access to /dev/net/tun for TUN/TAP devices
55- DeviceAllow = "/dev/net/tun rw" ;
56- # Access to /sys for network configuration
57- BindReadOnlyPaths = [
58- "/sys"
59- "/proc"
60- ] ;
61- # Protect the system while giving necessary access
62- ProtectSystem = "strict" ;
63- ProtectHome = true ;
64- NoNewPrivileges = true ;
65- # Allow the service to manage network namespaces
66- PrivateNetwork = false ;
47+ Restart = "on-failure" ;
48+ RestartSec = 2 ;
49+ KillMode = "process" ;
50+ KillSignal = "SIGINT" ;
51+ LimitNOFILE = 65536 ;
52+ LimitNPROC = "infinity" ;
53+ TasksMax = "infinity" ;
54+ OOMScoreAdjust = - 1000 ;
6755 } ;
6856 } ;
6957
70- # Setup defguard user & group
71- users . users . defguard = {
72- isSystemUser = true ;
73- group = "defguard" ;
74- } ;
75-
76- # Make sure the group exists
58+ # Make sure the defguard group exists
7759 users . groups . defguard = { } ;
7860 } ;
7961}
You can’t perform that action at this time.
0 commit comments