From fb1aeff33ca6a2b9d84c07d618174fe4fc8a2221 Mon Sep 17 00:00:00 2001 From: mloe Date: Sat, 22 Oct 2022 16:03:56 +0200 Subject: [PATCH] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0182144..4cacf08 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ loginctl enable-linger export XDG_RUNTIME_DIR=/run/user/$(id -u) ``` -Reboot your system. +Reboot your system and log in to the non-root account. Afterwards you have to check two environment variables: ``` @@ -30,9 +30,11 @@ echo $XDB_RUNTIME_DIR // should return something like /run/user/10 echo $DBUS_SESSION_BUS_ADDRESS // should return something like /run/user/1001/bus ``` -Now you can create user services under /home//.config/systemd/user. +Now you can create user services under /home/\/.config/systemd/user. The bot service should look something like this: ``` +# discord-bot.service + [Unit] Description=Test Discord Bot After=multi-user.target @@ -44,4 +46,14 @@ ExecStart=/usr/bin/python3.10 /home/marco/Projects/DiscordBot/bot.py [Install] WantedBy=multi-user.target +``` + +To control the service you then can do: +``` +systemctl --user [start/stop/restart] +``` + +To have the service start on boot do: +``` +systemctl --user enable ``` \ No newline at end of file