ellermister / mtproxy

MTProxyTLS一键安装绿色脚本
MIT License
1.13k stars 362 forks source link

推荐使用 systemctl 来守护和自启 #2

Open xinxin8816 opened 4 years ago

xinxin8816 commented 4 years ago

创建系统服务

cat > /etc/systemd/system/mtp.service <<EOF
[Unit]
Description=mtp
After=network.target

[Service]
Type=forking
ExecStart=/bin/bash /home/mtproxy/mtproxy.sh start
ExecReload=/bin/bash /home/mtproxy/mtproxy.sh restart
ExecStop=/bin/bash /home/mtproxy/mtproxy.sh stop

[Install]
WantedBy=multi-user.target
EOF

启动服务并设置开机自启

systemctl start mtp
systemctl enable mtp
superen7527 commented 10 months ago

哥们你开机自启有用吗我搞了一个通宵 开机起不来啊。。只能手动 延迟 什么的都试过了