1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39[Unit]
Description=OpenFang Agent OS Daemon
Documentation=https://github.com/openfang-ai/openfang
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=openfang
Group=openfang
ExecStart=/usr/local/bin/openfang start
Restart=on-failure
RestartSec=5
TimeoutStopSec=30
# Environment
EnvironmentFile=-/etc/openfang/env
WorkingDirectory=/var/lib/openfang
# Security hardening
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/var/lib/openfang
PrivateTmp=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
RestrictSUIDSGID=true
MemoryDenyWriteExecute=false
RestrictRealtime=true
# Resource limits
LimitNOFILE=65536
LimitNPROC=4096
[Install]
WantedBy=multi-user.target