[12.10] Auto start Daemon at login, Upstart Job not working

General support for problems installing or using Deluge
Post Reply
ablizno
New User
New User
Posts: 8
Joined: Sun Jan 27, 2013 8:10 am

[12.10] Auto start Daemon at login, Upstart Job not working

Post by ablizno »

I cannot seem to, for the life of me, get deluged daemon to start at login. The problem is i do not want to create a new user and group just for running deluged. I have tried doing so in hopes of getting it to work, and yet it still did not work. All i want, is for when i log in, for Deluged to start in the background. So that i can have my xbmc running and deluge in the background.

I have tried using

Code: Select all

# deluged - Deluge daemon
#
# The daemon component of Deluge BitTorrent client. Deluge UI clients
# connect to this daemon via DelugeRPC protocol.

description "Deluge daemon"
author "Deluge Team"

start on filesystem and stopped networking
stop on runlevel [016]

respawn
respawn limit 5 30

env uid=MYUSERNAME
env gid=MYUSERNAME  *as it seems doing an "id" returns my uid and gid as MYUSERNAME(1000)*
env umask=007

exec start-stop-daemon -S -c $uid:$gid -k $umask -x /usr/bin/deluged -- -d
but it does not work, once i log in it tells me deluged quit or crashed every time.


I also tried creating a deluged.conf file with nothing but

Code: Select all

/usr/bin/deluged --config=/home/USERNAME/.config/deluge
but that also does not work, i am getting very frustrated. i wish that i could just add deluge to Startup Applications but that does not start the daemon.
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: [12.10] Auto start Daemon at login, Upstart Job not work

Post by Cas »

If deluged quits or crashes there must be some other issue. There should be no issues adding deluged to startup applications and you do not need to change the config location if running as current user.

Can you connect from deluge to deluged manually run from terminal:

Code: Select all

deluged 
ablizno
New User
New User
Posts: 8
Joined: Sun Jan 27, 2013 8:10 am

Re: [12.10] Auto start Daemon at login, Upstart Job not work

Post by ablizno »

Yes And I can get it running fine once logged in. But cannot get it to auto start. I'm running lubuntu. Can you help me understand the script or write one that simply launches the daemon. I ha to change config location because that's where the config is located. I didn't change the location that's just the location it created the config at.


Edit: does my first "code" look right for the upstart thing? or do i have to change where it says $uid:$gid to my username and groupname? i typed "MYUSERNAME" to the place that im assuming i need to change? if not could someone please help me? i cannot get this daemon to launch at login which is frustrating. I noticed that it is not crashing, udisk something is crashing at login, not deluge.
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: [12.10] Auto start Daemon at login, Upstart Job not work

Post by Cas »

Does USERNAME in that config location match your username? The default config location without using '-c' is ~/.config/deluge so you should not need to specify it.

Is there a log in /var/log/upstart/deluged
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: [12.10] Auto start Daemon at login, Upstart Job not work

Post by Cas »

Ok I tested this myself on a VM Ubuntu with user ubuntu and works fine. are you remembering to start the service before restarting?

Code: Select all

start on filesystem and stopped networking
stop on runlevel [016]

respawn
respawn limit 5 30

env uid=ubuntu
env gid=ubuntu
env umask=007

exec start-stop-daemon -S -c $uid:$gid -k $umask -x /usr/bin/deluged -- -d
ablizno
New User
New User
Posts: 8
Joined: Sun Jan 27, 2013 8:10 am

Re: [12.10] Auto start Daemon at login, Upstart Job not work

Post by ablizno »

Yes deluged is running before restarting. However, i am unable to properly "reboot" the device. Would that matter? I have to shut it down then re power on. Or do you mean, am i remembering to start the script? If you are referring to the later. How would i go about starting the script/upstart job?
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: [12.10] Auto start Daemon at login, Upstart Job not work

Post by Cas »

As per the wiki:

Code: Select all

sudo service deluged start
ablizno
New User
New User
Posts: 8
Joined: Sun Jan 27, 2013 8:10 am

Re: [12.10] Auto start Daemon at login, Upstart Job not work

Post by ablizno »

Ok created a file like you said, Replaced "ubuntu" with "ablizno" started service the way you said, rebooted, didnt work. Also tried just "deluged" and "sudo start deluged" and still same thing, Nothing, when i boot deluge-gtk i still have to manually run the daemon. I guess there is nothing to do to get this to work and im just going to have to ssh and run the daemon each time manually. I guess its not that difficult to do. just wanted to get it to auto start and get any real advice besides copy and pasting from across the website as if i haven't already searched my ass off.
Post Reply