Skip to content

Latest commit

 

History

History
80 lines (78 loc) · 2.05 KB

File metadata and controls

80 lines (78 loc) · 2.05 KB

systemd Service for Linux

中文 | English

Installation and Usage

  • Download the binary executable file
  • Move the executable file to the /usr/bin/ directory and rename it to sticker_go_linux:
sudo mv sticker_go_linux /usr/bin/sticker_go_linux
  • Move the configuration file to the /etc/sticker_go/ directory:
sudo mkdir -p /etc/sticker_go
sudo mv config.yaml /etc/sticker_go/config.yaml
  • Create the systemd service file /etc/systemd/system/sticker_go.service with the following content:
[Unit]
Description=Sticker_go, A Simple but Powerful Telegram Sticker Conversion Bot.
After=network.target

[Service]
ExecStart=/usr/bin/sticker_go_linux -d /etc/sticker_go/
# Supports hot reload of configuration since v1.9.3, send SIGHUP signal to reload configuration
# Warning: Hot reload does NOT apply to changes in Telegram Bot Token, you must restart the service for changes to take effect
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
RestartSec=1

[Install]
WantedBy=multi-user.target
  • Reload the systemd configuration and start the service:
sudo systemctl daemon-reload
sudo systemctl start sticker_go
  • Enable the service to start on boot:
sudo systemctl enable sticker_go
  • Check the service status:
sudo systemctl status sticker_go
  • View the service logs:
sudo journalctl -u sticker_go -f
  • Stop the service:
sudo systemctl stop sticker_go
  • Restart the service:
sudo systemctl restart sticker_go

Remove the program and all its components

  • Stop the service:
sudo systemctl stop sticker_go
  • Disable the service:
sudo systemctl disable sticker_go
  • Delete the service file:
sudo rm /etc/systemd/system/sticker_go.service
  • Delete the executable file:
sudo rm /usr/bin/sticker_go_linux
  • Delete the configuration file:
sudo rm -r /etc/sticker_go
  • Reload the systemd configuration:
sudo systemctl daemon-reload