Setup opsdroid as a user service on a Raspberry Pi 3

A post from spudz.org

SETUP OPSDROID LIKE NORMAL

pip3 install opsdroid

Run opsdroid once to build a config opsdroid

SETUP LOCAL PI USER SERVICE

mkdir -p ~/.config/systemd/user

cd ~/.config/systemd/user

nano opsdroid.service

COPY THE FOLLOWING INTO THE EDITOR:

[Unit] Description=Opsdroid After=multi-user.target

[Service] User=%i Type=simple WorkingDirectory=/home/pi ExecStart=/usr/local/bin/opsdroid Restart=on-abort

[Install] WantedBy=multi-user.target

CTRL-o and CTRL-x to save and exit

Enable user lingering for systemd

sudo loginctl enable-linger pi

Enable the service as a user systemctl --user enable opsdroid

Start the service systemctl --user start opsdroid

To stop, restart, and get the status of the service use the following commands: systemctl --user stop opsdroid

systemctl --user restart opsdroid

systemctl --user status opsdroid

FINALLY USE THE OPSDROID DOCS TO SETUP YOUR NEW BOT.

Opsdroid Docs

bleak theme by Jack Preston