0

I have an old laptop hooked up to my router running as linux box. I installed qbittorrent to run as a remote torrent box (to download linux distros of course) and I created a new user, "qbuser" for it to run under. I created the appropriate unit file but when I look at the process list, it's running as root. Why this might be happening? result of top command

[Unit]
Description=qbittorrent-nox
Documentation=man:qbittorrent-nox
DefaultDependencies=yes
After=network-online.target nss-lookup.target
Before=multi-user.target

[Service]
User=[i][b]qbuser[/b][/i]
Group=[b]qb[/b]
Type=simple
ExecStart=/usr/bin/qbittorrent-nox [-options]
Nice=10
StandardError=null
StandardOutput=null
TimeoutSec=360s

[Install]
WantedBy=multi-user.target

Edit: I fixed the syntax errors in the unit file, now it just fails outright. I double checked that group qb and user qbuser exist. Here is the systemctl status output:

steve@debian-server:~$ sudo systemctl status qbittorrent
● qbittorrent.service - qbittorrent-nox
   Loaded: loaded (/etc/systemd/system/qbittorrent.service; enabled; vendor preset: enabled)
   Active: failed (Result: signal) since Fri 2019-01-25 23:31:07 CST; 6min ago
     Docs: man:qbittorrent-nox
  Process: 994 ExecStart=/usr/bin/qbittorrent-nox (code=killed, signal=ABRT)
 Main PID: 994 (code=killed, signal=ABRT)

Jan 25 23:31:07 debian-server systemd[1]: Started qbittorrent-nox.
Jan 25 23:31:07 debian-server systemd[1]: qbittorrent.service: Main process exited, code=killed, status=6/ABRT
Jan 25 23:31:07 debian-server systemd[1]: qbittorrent.service: Unit entered failed state.
Jan 25 23:31:07 debian-server systemd[1]: qbittorrent.service: Failed with result 'signal'.
  • 1
    Check the output of systemctl status qbittorrent-nox, as it might explain what is going on. Edit the description and paste it here, that might help us help you understand it. Your paste includes [i][b] markers, I'm expecting that's an artifact of your copy & paste, right? If they're really there, then that would explain why this isn't running as the specified user... – filbranden Jan 26 at 5:07
  • Oh crap, that's not actually supposed to be there? I had copied and pasted from another SO post. It worked without throwing any errors so I didn't think there was anything wrong with the syntax – Steve Jan 26 at 5:17
  • That's not supposed to be there, no. Also the [-options] part, you probably should replace that with your own options (and remove the square brackets.) If the user does not exist, systemd will log a warning and keep going as root. You'll see the log with the systemctl status qbittorrent-nox command. – filbranden Jan 26 at 5:25
  • @filbranden I fixed all that, now it just fails outright – Steve Jan 26 at 5:34
  • 1
    I figured out the problem I think. When I created qbuser's home directory(manually, after I created the acocunt) I didn't change the ownership so it doesn't have rw permissions in its own home directory. Will let you know if it works – Steve Jan 26 at 6:15
0

The problem is with the extra characters around the user and group name in your unit.

Instead of:

[Service]
User=[i][b]qbuser[/b][/i]
Group=[b]qb[/b]

You should use:

[Service]
User=qbuser
Group=qb

(Assuming group qb exists.)

Also the [-options] part, you probably should replace that with your own options (and remove the square brackets.)

If the user does not exist, systemd will log a warning and proceed running the service as root.

You can see the logs with the warning using the systemctl status qbittorrent-nox command, or journalctl -u qbittorrent-nox -e to show more of the logs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.