Skip to content

Instantly share code, notes, and snippets.

@TehPeGaSuS
Last active April 21, 2023 16:21
Show Gist options
  • Save TehPeGaSuS/037e1873b1f76220a47210be7a3c6abf to your computer and use it in GitHub Desktop.
Save TehPeGaSuS/037e1873b1f76220a47210be7a3c6abf to your computer and use it in GitHub Desktop.
Limnoria tricks and tips
[Unit]
Description=Limnoria
After=default.target
[Service]
Type=simple
WorkingDirectory=/home/bot/botname
ExecStart=/usr/local/bin/supybot botname.conf
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
[Install]
WantedBy=default.target
@TehPeGaSuS
Copy link
Author

TehPeGaSuS commented May 7, 2021

Systemd User Service

Using a systemd service is the recommended method to run Limnoira.
You must also use systemd as your init system (this is usually the case on Linux).

To enable systemd services as normal user (tested on Ubuntu 18.04+)

  • Run the following commands as the shell user where you'll be running your bot:
  • loginctl enable-linger
  • systemctl --user enable systemd-tmpfiles-clean.timer && systemctl --user disable systemd-tmpfiles-clean.timer
  • (The previous command will automatically create the needed ~/.config/systemd/user/ folder)
  • Place the above systemd service inside ~/.config/systemd/user/ and name it <BOTNAME>.service
  • Run systemctl --user daemon-reload to make systemd aware of changed files, systemctl --user enable <BOTNAME>.service to make the bot start on boot etc. and systemctl --user start <BOTNAME>.service to start the bot.

Some Useful Commands

  • autostart on boot: systemctl --user enable <BOTNAME>.service
  • disable autostart on boot: systemctl --user disable <BOTNAME>.service
  • start the bot: systemctl --user start <BOTNAME>.service
  • stop the bot: systemctl --user stop <BOTNAME>.service
  • reload config files: systemctl --user reload <BOTNAME>.service
  • show the latest logs: journalctl --user -fu <BOTNAME>.service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment