mirror of
https://github.com/HugeFrog24/go-telegram-bot.git
synced 2026-03-02 00:14:34 +00:00
Upgrade dependencies
Added tests, revised logging Removed dependency on env file Try reformatting unit file Comments clarification Added readme Added readme
This commit is contained in:
35
examples/systemd/telegram-bot.service
Executable file
35
examples/systemd/telegram-bot.service
Executable file
@@ -0,0 +1,35 @@
|
||||
[Unit]
|
||||
# A concise description of the service
|
||||
Description=Telegram Bot Service
|
||||
# Postpone starting until network is available
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
# The user that runs the bot
|
||||
User=tibik
|
||||
# The directory where the bot is located
|
||||
WorkingDirectory=/home/tibik/go-telegram-bot
|
||||
# The command to start the bot
|
||||
ExecStart=/home/tibik/go-telegram-bot/telegram-bot
|
||||
# Restart if crashed
|
||||
Restart=always
|
||||
# Delay between restarts to avoid resource exhaustion
|
||||
RestartSec=5
|
||||
# Capture stdout (INFO logs)
|
||||
StandardOutput=journal
|
||||
# Capture stderr (ERROR logs)
|
||||
StandardError=journal
|
||||
# Identifier for journalctl filtering
|
||||
SyslogIdentifier=telegram-bot
|
||||
|
||||
[Install]
|
||||
# The bot will start automatically at system boot
|
||||
WantedBy=multi-user.target
|
||||
|
||||
# NOTE:
|
||||
# New line comments: good
|
||||
# Inline comments: no good, they mess up the service file
|
||||
|
||||
# View logs: journalctl -u telegram-bot
|
||||
# Follow logs: journalctl -u telegram-bot -f
|
||||
# View errors: journalctl -u telegram-bot -p err
|
||||
Reference in New Issue
Block a user