You are not logged in.

#1 2021-02-19 19:48:38

omernaveedxyz
Member
Registered: 2020-12-31
Posts: 34

[Solved] Systemd service qBittorrent-nox "notify-send" not working

I have qbittorrent-nox running as a daemon service using systemctl. I access it through the web-ui. I have a post-download script setup that will send me a notification that the download is complete. However, no notification ever comes through. I am running DWM with dunst and have notify-send working on other scripts, just specifically not this one.

Post-download script:

#!/bin/sh

# %N - Torrent Filename $1
# %R - Root filepath $2

# Send notification
notify-send "[NEW]$1"

qbittorrent-nox.service:

[Unit]
Description=qBittorrent Daemon Service
After=network.target

[Service]
User=omer
Group=omer
ExecStart=/usr/bin/qbittorrent-nox
ExecStop=/usr/bin/killall -w qbittorrent-nox

[Install]
WantedBy=multi-user.target

Update: I know the script runs. If I run a different command (i.e. mv), the file is moved successfully. So this is strictly related to notify-send.

Update 2: "systemctl status qbittorrent-nox" shows nothing.

Last edited by omernaveedxyz (2021-02-19 20:24:37)

Offline

#2 2021-02-19 20:14:16

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: [Solved] Systemd service qBittorrent-nox "notify-send" not working

You probably have to set the ${DBUS_SESSION_BUS_ADDRESS}, see the Arch Wiki on Cron [0].

[0] https://wiki.archlinux.org/index.php/Cr … plications

Offline

#3 2021-02-19 20:24:10

omernaveedxyz
Member
Registered: 2020-12-31
Posts: 34

Re: [Solved] Systemd service qBittorrent-nox "notify-send" not working

respiranto wrote:

You probably have to set the ${DBUS_SESSION_BUS_ADDRESS}, see the Arch Wiki on Cron [0].

[0] https://wiki.archlinux.org/index.php/Cr … plications

Worked perfectly! Just had to "echo ${DBUS_SESSION_BUS_ADDRESS}" and set that as an environment variable in systemd service.

[Unit]
Description=qBittorrent Daemon Service
After=network.target

[Service]
User=omer
Group=omer
Environment="DBUS_SESSION_BUS_ADDRESS={RESULT OF ECHO DBUS_SESSION_BUS_ADDRESS}"
ExecStart=/usr/bin/qbittorrent-nox
ExecStop=/usr/bin/killall -w qbittorrent-nox

[Install]
WantedBy=multi-user.target

Last edited by omernaveedxyz (2021-02-19 21:38:55)

Offline

Board footer

Powered by FluxBB