Getting Deluge To Start On Reboot (Synology NAS)

General support for problems installing or using Deluge
metal450
Member
Member
Posts: 13
Joined: Thu Sep 05, 2013 7:38 am

Re: Getting Deluge To Start On Reboot (Synology NAS)

Post by metal450 »

You mean make a script that calls the start script, rather than just calling the start script? Why would that make a difference? I'm really not a linux person, but to put that in Windows terms - calling a batch file, or calling a batch file that calls a batch file...sounds like the same result to me :P
Symbiot
Member
Member
Posts: 21
Joined: Thu Oct 31, 2013 4:11 pm

Re: Getting Deluge To Start On Reboot (Synology NAS)

Post by Symbiot »

it would just be for testing.
best bet is adding it directly to debian:

http://www.debian-administration.org/articles/28

though I haven't tried it my self.
metal450
Member
Member
Posts: 13
Joined: Thu Sep 05, 2013 7:38 am

Re: Getting Deluge To Start On Reboot (Synology NAS)

Post by metal450 »

I've already done that. Please see my very first post in this thread.
haylocki
New User
New User
Posts: 2
Joined: Tue Aug 23, 2011 1:21 pm

Re: Getting Deluge To Start On Reboot (Synology NAS)

Post by haylocki »

Don't know if this will help you, but worked for me.

I had to change the file ownership of the log file directory to the username I put in "/etc/init.d/deluge-daemon"

i.e.

Code: Select all

sudo chown -R <USERNAME>:<USERNAME> /var/log/deluge 
Cheers, Ian
metal450
Member
Member
Posts: 13
Joined: Thu Sep 05, 2013 7:38 am

Re: Getting Deluge To Start On Reboot (Synology NAS)

Post by metal450 »

Already is that way. The startup script I'm using is this one: http://dev.deluge-torrent.org/wiki/User ... ipt/Ubuntu, which I have running as root - and /var/log/deluge is owned by root. That's what u mean, right?

So u actually do have it starting up automatically on reboot? If so, mind sharing your startup script (if different from the link above)? :)
kevinman117
New User
New User
Posts: 3
Joined: Thu Feb 20, 2014 2:29 am

Re: Getting Deluge To Start On Reboot (Synology NAS)

Post by kevinman117 »

Sorry to bring this up, but this thread is shown by google as first result so I think it might come in handy for other people trying to solve this problem.

I've done these things to run deluge at boot:
1) vi /usr/syno/etc/rc.d/S92delugeweb.sh
2) paste this script

case $1 in
start)
chroot /volume1/debianchrootdir/ su - yourusername -c "/usr/bin/deluged"
chroot /volume1/debianchrootdir/ su - yourusername -c "/usr/bin/deluge-web --fork"
;;
stop)
pkill -f "/usr/bin/python /usr/bin/deluged"
pkill -f "/usr/bin/python /usr/bin/deluge-web --fork"
;;
*)
echo "Usage: $0 [start|stop]"
;;
esac

3) save the file and chmod 755 /usr/syno/etc/rc.d/S92delugeweb.sh
4) vi ~.config/deluge/web.conf
5) replace "default_daemon": "" with "default_daemon": "127.0.0.1:58846"
6) save and chmod 444 ~.config/deluge/web.conf
7) reboot and watch the magic ;)

updated deluge-web and pkill
Last edited by kevinman117 on Fri Feb 28, 2014 10:52 am, edited 1 time in total.
metal450
Member
Member
Posts: 13
Joined: Thu Sep 05, 2013 7:38 am

Re: Getting Deluge To Start On Reboot (Synology NAS)

Post by metal450 »

kevinman117 wrote: I've done these things to run deluge at boot:
1) vi /usr/syno/etc/rc.d/S92delugeweb.sh
2) paste this script

case $1 in
start)
chroot /volume1/debianchrootdir/ su - yourusername -c "/usr/bin/deluged"
chroot /volume1/debianchrootdir/ su - yourusername -c "/usr/bin/deluge-web"
;;
stop)
pkill deluge*
;;
*)
echo "Usage: $0 [start|stop]"
;;
esac

3) save the file and chmod 755 /usr/syno/etc/rc.d/S92delugeweb.sh
Uhmmm...ok, so this seems to have caused me a big problem. The script indeed caused deluge to launch on reboot (note: my chrootdir was /usr/local/debian-chroot/var/chroottarget)...BUT...nothing else comes up! In other words, I can access Deluge from the thin client, but DSM never finishes booting - I can't access the web interface NOR ssh, and so I have no way to get into the device to turn this back off.

What on earth should I do now? I don't have physical access to the device, but I called someone who's there and had them hard reboot it, same thing: Deluge comes up, but nothing else.
metal450
Member
Member
Posts: 13
Joined: Thu Sep 05, 2013 7:38 am

Re: Getting Deluge To Start On Reboot (Synology NAS)

Post by metal450 »

Well that was a nightmare. You forgot a *critical* switch: you need to specify the --fork parameter to deluge-web, otherwise it won't terminate, nor will the start script, and thus, the device will lock up and not finish booting. I was only able to fix this by pulling the drive, hooking it up to another linux machine, & renaming the deluge binaries (so that when I put it back in the DiskStation they'd fail to start, and the script would terminate & DSM would boot).

So...the start script should be:

case $1 in
start)
chroot /usr/local/debian-chroot/var/chroottarget su - root -c "/usr/bin/deluged"
chroot /usr/local/debian-chroot/var/chroottarget su - root -c "/usr/bin/deluge-web --fork"
;;
stop)
pkill deluge*
;;
*)
echo "Usage: $0 [start|stop]"
;;
esac
kevinman117
New User
New User
Posts: 3
Joined: Thu Feb 20, 2014 2:29 am

Re: Getting Deluge To Start On Reboot (Synology NAS)

Post by kevinman117 »

Sorry guys, I swear I've tested the script before posting it here! Yesterday I've got the same problem: deluge runs fine, but DSM not... Then I sshed into the nas and disabled the script. Then DSM was able to start. It's weird that the lock-ups occurred occasionally. But thanks for improving/correcting my script metal450!

Updated previous post
Daredee
Member
Member
Posts: 12
Joined: Sat Oct 04, 2014 4:49 pm

Re: Getting Deluge To Start On Reboot (Synology NAS)

Post by Daredee »

to use my synology shared folder bt2 is this command right?

Code: Select all

mount -o bind /volume2/bt2/ /volume2/@appstore/debian-chroot/var/chroottarget/volume2/bt2/
will all torrent data be available in /volume2/bt2/ dir?
Post Reply