|
研究了下 其实挺简单
dsm7的群晖 启动项管理 变成了 systemd
路径在 /usr/lib/systemd/system/
那么就简单了
- // ssh登陆群晖 然后切换成rootsudo -scd /volume1/@apphomemkdir NezhaAgent// 这里得注意 下载你群晖对应架构的agentwget https://github.com/naiba/nezha/releases/download/v0.12.3/nezha-agent_linux_amd64.tar.gztar -zxvf nezha-agent_linux_amd64.tar.gzchmod +x nezha-agent//下面就设置systemd脚本vim /usr/lib/systemd/system/nezha-agent.service[Unit]Description=Nezha AgentAfter=syslog.target#After=network.target#After=nezha-dashboard.service[Service]# Modify these two values and uncomment them if you have# repos with lots of files and get an HTTP error 500 because# of that####LimitMEMLOCK=infinity#LimitNOFILE=65535Type=simpleUser=rootGroup=rootWorkingDirectory=/volume1/@apphome/NezhaAgentExecStart=/volume1/@apphome/NezhaAgent/nezha-agent --report-delay 3 --disable-command-execute --skip-conn --skip-procs -s 你自己的服务器:443 -p 你自己的密钥 --tlsRestart=always#Environment=DEBUG=true# Some distributions may not support these hardening directives. If you cannot start the service due# to an unknown option, comment out the ones not supported by your version of systemd.#ProtectSystem=full#PrivateDevices=yes#PrivateTmp=yes#NoNewPrivileges=true[Install]WantedBy=multi-user.target//然后启用就行了systemctl daemon-reloadsystemctl enable nezha-agentsystemctl start nezha-agent// 看下状态systemctl status nezha-agent
复制代码
就这么简单 |
|