[Unit]
Description=Guanghu Fifth Domain signed sync and receipt agent
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
# 安装器必须替换为现有受控接收器实际运行的系统用户；不得把旧目录名当作 Linux 用户名。
User=__RUN_AS_USER__
WorkingDirectory=/opt/zhuyuan/fifth-domain/server-tools/fifth-domain-sync-agent
Environment=FIFTH_DOMAIN_SYNC_CONFIG=/etc/guanghu/fifth-domain-sync-agent.json
EnvironmentFile=/etc/guanghu/fifth-domain-sync-agent.env
ExecStart=/usr/bin/node /opt/zhuyuan/fifth-domain/server-tools/fifth-domain-sync-agent/sync-agent.js
Restart=on-failure
RestartSec=5
NoNewPrivileges=true
PrivateTmp=true
ProtectHome=true
ProtectSystem=strict
ReadWritePaths=/opt/zhuyuan/fifth-domain /var/lib/guanghu-fifth-domain-sync-agent

[Install]
WantedBy=multi-user.target
