Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xinxin8816 opened this issue Aug 25, 2020 · 1 comment
Open

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

xinxin8816 opened this issue Aug 25, 2020 · 1 comment

Comments

@xinxin8816
Copy link

xinxin8816 commented Aug 25, 2020

#创建系统服务

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants