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

关于守护进程 #45

Open
9zg opened this issue Sep 2, 2019 · 3 comments
Open

关于守护进程 #45

9zg opened this issue Sep 2, 2019 · 3 comments

Comments

@9zg
Copy link

9zg commented Sep 2, 2019

有没有合适的方法为bot创建守护进程?

@ghost
Copy link

ghost commented Sep 8, 2019

我以前写的

cat << EOF > /lib/systemd/system/rssbot.service
[Unit]
Description=rssbot
After=network.target
[Service]
Type=simple
user=root
ExecStart=/root/rssbot/rssbot /root/rssbot/data.json 这里写你的token
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl enable rssbot
service rssbot start
service rssbot status

@cmp0xff
Copy link

cmp0xff commented Feb 4, 2020

这个方法

我以前写的
cat << EOF > /lib/systemd/system/rssbot.service
[Unit]
Description=rssbot
After=network.target
[Service]
Type=simple
user=root
ExecStart=/root/rssbot/rssbot /root/rssbot/data.json 这里写你的token
Restart=always
[Install]
WantedBy=multi-user.target
EOF

systemctl enable rssbot
service rssbot start
service rssbot status

这个方法得有 root 权限才可以吧?

@ghost
Copy link

ghost commented Feb 4, 2020

这个方法

我以前写的
cat << EOF > /lib/systemd/system/rssbot.service
[Unit]
Description=rssbot
After=network.target
[Service]
Type=simple
user=root
ExecStart=/root/rssbot/rssbot /root/rssbot/data.json 这里写你的token
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl enable rssbot
service rssbot start
service rssbot status

这个方法得有 root 权限才可以吧?

是的

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