From 6d20ec3a1bd616968144d2969762a0da9b93ef15 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Mon, 3 May 2021 23:49:52 +0200 Subject: [PATCH] supybot-botchk: Swap the two sections, to have systemd first --- use/supybot-botchk.rst | 94 +++++++++++++++++++++--------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/use/supybot-botchk.rst b/use/supybot-botchk.rst index 589c9ea..3c9630c 100644 --- a/use/supybot-botchk.rst +++ b/use/supybot-botchk.rst @@ -9,6 +9,53 @@ in case of crash or system reboot or anything that can make the bot quit. Note that you only need to use one. +systemd service +=============== + +You need root access as no one has got this to work as user service yet. +You must also use systemd as your init. + +Create a new file ``/etc/systemd/system/.service`` with the +following content replacing things were suitable:: + + [Unit] + Description=Supybot + After=network.target + + [Service] + Environment="PATH=/usr/local/bin:/usr/local/sbin:/usr/local/games:/usr/bin:/usr/sbin:/usr/games:/bin:/sbin:/bin:/opt/local/bin:/opt/local/sbin:/opt/local/games TZ=UTC" + Type=simple + ExecStart=/usr/local/bin/supybot /home/bot/botname/botname.conf + ExecReload=/bin/kill -HUP $MAINPID + Restart=always + User=BOTUSERNAME + SyslogIdentifier=Supybot + # Uncomment these lines for extra security at the cost of breaking some third-party plugins: + # SystemCallFilter=~@raw-io @clock @cpu-emulation @debug @keyring @module @mount @obsolete @privileged @raw-io + # ProtectSystem=strict + # ProtectHome=read-only + # ReadWritePaths=/home/bot/botname + + [Install] + WantedBy=multi-user.target + +Now you should run ``systemctl daemon-reload`` to make systemd aware +of changed files and ``systemctl enable .service`` to make the +bot start on boot etc. and ``systemctl start .service`` to start +the bot. + +Remember to check the ``Environment`` line. You can get your PATH with +``printf 'PATH=%s\n' "$PATH"``. + +Some commands +------------- + +* autostart on boot: ``systemctl enable .service`` +* disable autostart on boot: ``systemctl disable .service`` +* start the bot: ``systemctl start .service`` +* stop the bot: ``systemctl stop .service`` +* reload config files: ``systemctl reload .service`` + supybot-botchk ============== @@ -79,50 +126,3 @@ If you are wondering what ``*/5 * * * *`` means, it simply means "run this every five minutes every day". The 5 can be replaced with any other number and there are also ``@hourly`` etc. which can be used on it's place, but you most likely won't want to wait hour or more if your bot crashes. - -systemd service -=============== - -You need root access as no one has got this to work as user service yet. -You must also use systemd as your init. - -Create a new file ``/etc/systemd/system/.service`` with the -following content replacing things were suitable:: - - [Unit] - Description=Supybot - After=network.target - - [Service] - Environment="PATH=/usr/local/bin:/usr/local/sbin:/usr/local/games:/usr/bin:/usr/sbin:/usr/games:/bin:/sbin:/bin:/opt/local/bin:/opt/local/sbin:/opt/local/games TZ=UTC" - Type=simple - ExecStart=/usr/local/bin/supybot /home/bot/botname/botname.conf - ExecReload=/bin/kill -HUP $MAINPID - Restart=always - User=BOTUSERNAME - SyslogIdentifier=Supybot - # Uncomment these lines for extra security at the cost of breaking some third-party plugins: - # SystemCallFilter=~@raw-io @clock @cpu-emulation @debug @keyring @module @mount @obsolete @privileged @raw-io - # ProtectSystem=strict - # ProtectHome=read-only - # ReadWritePaths=/home/bot/botname - - [Install] - WantedBy=multi-user.target - -Now you should run ``systemctl daemon-reload`` to make systemd aware -of changed files and ``systemctl enable .service`` to make the -bot start on boot etc. and ``systemctl start .service`` to start -the bot. - -Remember to check the ``Environment`` line. You can get your PATH with -``printf 'PATH=%s\n' "$PATH"``. - -Some commands -------------- - -* autostart on boot: ``systemctl enable .service`` -* disable autostart on boot: ``systemctl disable .service`` -* start the bot: ``systemctl start .service`` -* stop the bot: ``systemctl stop .service`` -* reload config files: ``systemctl reload .service``