From 273b3ee1eb1fb2e4942614359ed7506ba6b199f2 Mon Sep 17 00:00:00 2001 From: yii Date: Wed, 17 Mar 2021 11:37:34 +0800 Subject: [PATCH] fix systemd --- README.md | 16 ++++++++++++++++ systemd/anylink.service | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2333538..c68a67e 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,22 @@ sudo ./anylink -conf="conf/server.toml" [conf/server.toml](server/conf/server.toml) +## systemd + +添加 systemd脚本 +* anylink 程序目录放入 `/usr/local/anylink-deploy` + +systemd 脚本放入: +* centos: `/usr/lib/systemd/system/` +* ubuntu: `/lib/systemd/system/` + +操作命令: +* 启动: `systemctl start anylink` +* 停止: `systemctl stop anylink` +* 开机自启: `systemctl enable anylink` + + + ## Setting 网络模式选择,需要配置 `link_mode` 参数,如 `link_mode="tun"`,`link_mode="tap"` 两种参数。 不同的参数需要对服务器做相应的设置。 diff --git a/systemd/anylink.service b/systemd/anylink.service index 29e6661..2403d1e 100644 --- a/systemd/anylink.service +++ b/systemd/anylink.service @@ -8,6 +8,6 @@ User=root WorkingDirectory= /usr/local/anylink-deploy Restart=on-failure RestartSec=5s -ExecStart=/usr/local/anylink-deploy/anylink -conf="conf/server.toml" +ExecStart=/usr/local/anylink-deploy/anylink -conf=conf/server.toml [Install] WantedBy=multi-user.target