InitScripts ubuntu, halt deluged

Suggestions and discussion of future versions
Post Reply
c228182
Member
Member
Posts: 24
Joined: Sat May 29, 2010 12:25 pm

InitScripts ubuntu, halt deluged

Post by c228182 »

In this script: http://dev.deluge-torrent.org/wiki/User ... ipt/Ubuntu
this is the stop function:

Code: Select all

do_stop()
{
   # Return
   #   0 if daemon has been stopped
   #   1 if daemon was already stopped
   #   2 if daemon could not be stopped
   #   other if a failure occurred

   start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --user $DELUGED_USER --pidfile $PIDFILE2
   RETVAL2="$?"
   start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --user $DELUGED_USER --pidfile $PIDFILE1
   RETVAL1="$?"
   [ "$RETVAL1" = "2" -o "$RETVAL2" = "2" ] && return 2

   rm -f $PIDFILE1 $PIDFILE2

   [ "$RETVAL1" = "0" -a "$RETVAL2" = "0" ] && return 0 || return 1
}
This kill the daemon or halt the daemon?
If the daemon was killed during a download, at the restart the download is must checked.
But if I stop manually deluged the torrents mustn't cheched...

True?

Is better stop whit initscript or this:

Code: Select all

su DELUGEUSER
deluge-console halt
exit
???
c228182
Member
Member
Posts: 24
Joined: Sat May 29, 2010 12:25 pm

Re: InitScripts ubuntu, halt deluged

Post by c228182 »

:?:
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: InitScripts ubuntu, halt deluged

Post by johnnyg »

If deluged gets sent a SIGTERM, then it will shutdown properly and won't recheck torrents on startup.
Post Reply