We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 提到的 root 权限, 分享一个使用普通用户的 systemd file 和相关配置
tg-bot
useradd tg-bot -s /usr/sbin/nologin
rssbot.json
sudo mkdir /var/lib/tg-bots-data sudo chown tg-bot:tg-bot /var/lib/tg-bots-data
/etc/systemd/system/rssbot.service
[Unit] Description = RSS Bot for Telegram Documentation = https://github.com/iovxw/rssbot After = network.target Wants = network-online.target [Service] # 对于 systemd 版本 240 及以上, 取消注释 `Type=exec`, 注释掉 `Type=simple` # Type=exec Type = simple User = tg-bot Group = tg-bot NoNewPrivileges = yes ExecStart = /path/to/rssbot -d /var/lib/tg-bots-data/rssbot.json <token> [Install] WantedBy = multi-user.target
/path/to/rssbot 改成自己的可执行文件路径, <token> 改成自己的 token.
/path/to/rssbot
<token>
sudo systemctl daemon-reload sudo systemctl start rssbot.service sudo systemctl enable rssbot.service systemctl status rssbot.service
ps -ef | grep rssbot
tg-bot 28290 1 0 06:47 ? 00:00:57 /path/to/rssbot -d /var/lib/tg-bots-data/rssbot.json <token>
当然直接用 root 也可以...不过跑自己服务器上的东西还是想尽量简单嘛
The text was updated successfully, but these errors were encountered:
也可以考虑 systemd-run,一行解决:systemd-run rssbot <token> 本质上是创建临时 service
systemd-run
systemd-run rssbot <token>
Sorry, something went wrong.
No branches or pull requests
关于 #45 提到的 root 权限, 分享一个使用普通用户的 systemd file 和相关配置
tg-bot
并禁止登录tg-bot
建立用于放置rssbot.json
的文件夹,/etc/systemd/system/rssbot.service
, 写入sudo systemctl daemon-reload sudo systemctl start rssbot.service sudo systemctl enable rssbot.service systemctl status rssbot.service
ps -ef | grep rssbot
查看:当然直接用 root 也可以...不过跑自己服务器上的东西还是想尽量简单嘛The text was updated successfully, but these errors were encountered: