28 lines
756 B
Bash
28 lines
756 B
Bash
# 参考 https://www.boris1993.com/self-hosting-tailscale-derp.html
|
||
|
||
|
||
# /etc/systemd/system/derper-server.service
|
||
|
||
[Unit]
|
||
# 服务名字
|
||
Description=Tailscale DERP Server
|
||
# 在网络服务启动后启动这个服务
|
||
After=network.target
|
||
|
||
[Service]
|
||
# 改成你的用户名
|
||
User=root
|
||
# 总是自动重新启动
|
||
Restart=always
|
||
# 重启前等待5秒
|
||
RestartSec=5
|
||
# 启动derper的命令,跟上面测试用的命令一样
|
||
ExecStart=/root/go/bin/derper -c=/root/app-install/derper/derper.conf -hostname derper.107421.xyz -a :21443 -certmode manual -certdir /root/app-install/derper/
|
||
# 停止derper的命令
|
||
ExecStop=/bin/kill $MAINPID
|
||
# 赋予CAP_NET_BIND_SERVICE这个capability
|
||
#AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||
|
||
[Install]
|
||
WantedBy=multi-user.target
|