From bcaefe7eb7f80ce22b43415fdcfc2213474b57c5 Mon Sep 17 00:00:00 2001 From: Vitor Luis Date: Tue, 19 May 2020 22:47:52 +0200 Subject: [PATCH 1/3] Create bitbot_user.service Systemd script to be used by the user w/o the need of root access. Probably useful. Cheers --- docs/systemd/bitbot_user.service | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 docs/systemd/bitbot_user.service diff --git a/docs/systemd/bitbot_user.service b/docs/systemd/bitbot_user.service new file mode 100644 index 00000000..d54aeba8 --- /dev/null +++ b/docs/systemd/bitbot_user.service @@ -0,0 +1,32 @@ +# This systemd script was made to be used in Ubuntu 18.04 LTS +# Check your distro and make the appropriate changes if needed +# In order to allow the user to run their own systemd scripts +# you need to type the following as root: +# loginctl enable-linger $USER (replace $USER with the shell username) +# User systemd scripts are placed inside /home/$USER/.config/systemd/user +# All commands are issued as: systemctl --user [start|stop|restart|reload|enable|disable] service_name.service +# If the folder doesn't exist, type: systemctl --user enable systemd-tmpfiles-clean.timer +# This will automatically create the folder and enable the tempfiles clean timer, +# which can be disabled with: systemctl --user disable systemd-tmpfiles-clean.timer +# +# After placing this script in the correct location, and with bitbot stopped, type: +# systemctl --user enable bitbot_user.service --now +# This will enable the systemd script and launch bitbot + +[Unit] +Description=BitBot Service (User) +Wants=dafault.target +After=default.target + +[Service] +# change any of the 4 following lines as applicable +# The %h will be replaced with the user home directory +# like /home/bitbot +WorkingDirectory=%h/bitbot +ExecStart=/usr/bin/env python3 %h/bitbot/bitbotd +ExecStop=/usr/bin/env python3 %h/bitbot/bitbotctl stop +ExecReload=/usr/bin/env python3 %h/bitbot/bitbotctl reload +Restart=always + +[Install] +WantedBy=dafault.target From 98573f1d49f25c90f9dc456b398cbd0b5815b2fd Mon Sep 17 00:00:00 2001 From: Vitor Luis Date: Tue, 19 May 2020 22:49:56 +0200 Subject: [PATCH 2/3] Update bitbot_user.service Fixed a stupid typo --- docs/systemd/bitbot_user.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/systemd/bitbot_user.service b/docs/systemd/bitbot_user.service index d54aeba8..fef2cc38 100644 --- a/docs/systemd/bitbot_user.service +++ b/docs/systemd/bitbot_user.service @@ -15,7 +15,7 @@ [Unit] Description=BitBot Service (User) -Wants=dafault.target +Wants=default.target After=default.target [Service] From 8a5a28b08b6d527c6a999c91de2a09456a4e7d01 Mon Sep 17 00:00:00 2001 From: Vitor Luis Date: Tue, 19 May 2020 22:52:07 +0200 Subject: [PATCH 3/3] Update bitbot_user.service Next time i need to triple check what I am doing. Another stupid typo --- docs/systemd/bitbot_user.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/systemd/bitbot_user.service b/docs/systemd/bitbot_user.service index fef2cc38..ed8d014b 100644 --- a/docs/systemd/bitbot_user.service +++ b/docs/systemd/bitbot_user.service @@ -29,4 +29,4 @@ ExecReload=/usr/bin/env python3 %h/bitbot/bitbotctl reload Restart=always [Install] -WantedBy=dafault.target +WantedBy=default.target