Deluge systemd.service for Ubuntu 16.04

General support for problems installing or using Deluge
Post Reply
ajssbp
New User
New User
Posts: 4
Joined: Mon May 30, 2016 1:41 am

Deluge systemd.service for Ubuntu 16.04

Post by ajssbp »

Hello,

I am trying to get deluge + web_ui to run at boot on my webserver. I copied the instructions and systemd service files from here:

http://dev.deluge-torrent.org/wiki/User ... ce/systemd

But they don't work.... When I do a systemctl status deluged it gives me :

Failed to start Deluge BitTorent Client Daemon
Unit entered failed state

However, if I just open up the command line and enter deluged followed by deluge-web -f everything works perfectly. I just want those commands to execute on boot. I don't know if something changed with the new version of systemd in Ubuntu 16.04 or if that guide isn't right, but it doesn't seem to be working for me. Any help would be much appreciated. Thanks.
Shryp
Moderator
Moderator
Posts: 521
Joined: Mon Apr 20, 2015 10:20 pm

Re: Deluge systemd.service for Ubuntu 16.04

Post by Shryp »

I am not sure about Unity, but I know KDE, Mate and XFCE will let you add custom commands to the startup programs. Look around in your settings for startup programs and you can just put your command line stuff there.
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Deluge systemd.service for Ubuntu 16.04

Post by Cas »

You need to look at the logs for systemd to find out why it failed. They should work fine on 16.04, the likeliest answer is a mistake in creating the files.
ajssbp
New User
New User
Posts: 4
Joined: Mon May 30, 2016 1:41 am

Re: Deluge systemd.service for Ubuntu 16.04

Post by ajssbp »

So digging into the logs further than I went before, the systemd error is:

failed at step USER spawning /usr/bin/deluged: No such process

So is this telling me that there is no file at /usr/bin/deluged (because there is), or is it saying systemd doesn't know what user to start the process as?
ajssbp
New User
New User
Posts: 4
Joined: Mon May 30, 2016 1:41 am

Re: Deluge systemd.service for Ubuntu 16.04

Post by ajssbp »

Thinking some more, I decided to check what the default user and group for deluge is, and it apparently isn't deluge, it is debian-deluged. Also, the guide is incorrect in that the .service files are stored in /lib/systemd/system, not /etc.

Making those changes the daemon and web-ui both now start on boot and looking at the journalctl file it says the Daemon and Web Interface are both started successfully.

and again they are located in

Code: Select all

/lib/systemd/system/
NOT /etc/systemd/system/

With these changes the services started and were enabled successfully and both the daemon and web-ui started on boot.
Last edited by Cas on Mon May 30, 2016 11:19 pm, edited 1 time in total.
Reason: Removed inaccurate and potentially misleading service files
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Deluge systemd.service for Ubuntu 16.04

Post by Cas »

If you created a deluge user then don't use debian-deluge as that is created from the Ubuntu Deluge package and is not part of the steps of the wiki.

You should absolutely use /etc/systemd/system/ (and not /lib/systemd), though there appears to have been a change requiring a dedicated step to enable it:

Code: Select all

systemctl enable /etc/systemd/system/deluged.service
I have updated the wiki to reflect this change.
ajssbp
New User
New User
Posts: 4
Joined: Mon May 30, 2016 1:41 am

Re: Deluge systemd.service for Ubuntu 16.04

Post by ajssbp »

Cas,

I did create the deluge user, but for some reason it wasn't working. I could have goofed something up, but I don't know. Just out of curiosity, if the install package creates the debian-deluge user, why create another user for the start script? When I checked the permissions of debian-deluge it was only part of the debian-deluge group and the owner of the files it installed. Guess I'm just wondering why another user should be created.
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Deluge systemd.service for Ubuntu 16.04

Post by Cas »

It's created by a package so could easily have differences with where config is stored by default so the wiki instructions need to be followed as is to prevent issues. The package should really be updated to use systemd by maintainers and create a deluge user.
Post Reply