Changes between Version 1 and Version 2 of UserGuide/InitScript/OpenSUSE


Ignore:
Timestamp:
10/23/2010 07:41:15 AM (12 years ago)
Author:
samuel337
Comment:

Tidied up script; fixed issue with loading plugins.

Legend:

Unmodified
Added
Removed
Modified
  • UserGuide/InitScript/OpenSUSE

    v1 v2  
    11= openSUSE Init Script = 
    22 
    3 == Deluged == 
     3== Deluge daemon (deluged) == 
    44 
    55{{{ 
    6 #!sh 
    76#! /bin/sh 
    87# Copyright (c) 1995-2000 SuSE GmbH Nuernberg, Germany. 
     
    1514# 
    1615# /usr/sbin/deluged 
     16# 
     17# FROM http://dev.deluge-torrent.org/wiki/UserGuide/InitScript/OpenSUSE 
    1718# 
    1819### BEGIN INIT INFO 
     
    3334test -x $DELUGED_BIN || exit 5 
    3435 
    35 DELUGED_USER="deluge"        # CHANGE THIS 
     36DELUGED_USER="deluge" 
    3637test -n "$DELUGED_USER" || exit 6 
    3738 
    38 DELUGED_PIDFILE=~/.config/deluge/deluged.pid 
    39  
    40 DELUGED_ARGS="-P DELUGED_PIDFILE" # consult man deluged for more options 
     39DELUGED_PIDFILE=/home/$DELUGED_USER/.config/deluge/deluged.pid 
     40 
     41DELUGED_ARGS="-c /home/$DELUGED_USER/.config/deluge/ -P $DELUGED_PIDFILE" # consult man deluged for more options 
     42 
     43PYTHON_EGG_CACHE=/home/$DELUGED_USER/.python-eggs 
    4144 
    4245. /etc/rc.status 
     
    5760    start) 
    5861         
    59         echo -n "Starting DELUGE daemon" 
    60         ## Start daemon with startproc(8). If this fails 
    61         ## the echo return value is set appropriate. 
    62  
    63         startproc -p $DELUGED_PIDFILE -u $DELUGED_USER $DELUGED_BIN $DELUGED_ARGS 
    64  
    65         # Remember status and be verbose 
    66         rc_status -v 
    67         ;; 
     62        echo -n "Starting DELUGE daemon" 
     63        ## Start daemon with startproc(8). If this fails 
     64        ## the echo return value is set appropriate. 
     65         
     66        export PYTHON_EGG_CACHE 
     67        startproc -l /var/log/deluged.log -p $DELUGED_PIDFILE -u $DELUGED_USER $DELUGED_BIN $DELUGED_ARGS 
     68 
     69        # Remember status and be verbose 
     70        rc_status -v 
     71        ;; 
    6872    stop) 
    69         echo -n "Shutting down DELUGE daemon" 
    70         ## Stop daemon with killproc(8) and if this fails 
    71         ## set echo the echo return value. 
    72  
    73         killproc -TERM $DELUGED_BIN 
    74  
    75         # Remember status and be verbose 
    76         rc_status -v 
    77         ;; 
     73        echo -n "Shutting down DELUGE daemon" 
     74        ## Stop daemon with killproc(8) and if this fails 
     75        ## set echo the echo return value. 
     76 
     77        killproc -TERM $DELUGED_BIN 
     78 
     79        # Remember status and be verbose 
     80        rc_status -v 
     81        ;; 
    7882    try-restart) 
    7983        ## Stop the service and if this succeeds (i.e. the  
     
    9498        ;; 
    9599    force-reload|reload) 
    96         ## Signal the daemon to reload its config. Most daemons 
    97         ## do this on signal 1 (SIGHUP). 
    98  
    99         echo -n "Reload service DELUGED" 
    100  
    101         killproc -HUP $DELUGED_BIN 
     100        ## Signal the daemon to reload its config. Most daemons 
     101        ## do this on signal 1 (SIGHUP). 
     102 
     103        echo -n "Reload service DELUGED" 
     104 
     105        killproc -HUP $DELUGED_BIN 
    102106 
    103107        rc_status -v 
     
    105109        ;; 
    106110    status) 
    107         echo -n "Checking for service DELUGED " 
     111        echo -n "Checking for service DELUGED " 
    108112        ## Check status with checkproc(8), if process is running 
    109113        ## checkproc will return with exit status 0. 
     
    115119        # 3 - service not running 
    116120 
    117         checkproc $DELUGED_BIN 
    118  
    119         rc_status -v 
    120         ;; 
     121        checkproc $DELUGED_BIN 
     122 
     123        rc_status -v 
     124        ;; 
    121125    probe) 
    122         ## Optional: Probe for the necessity of a reload, 
    123         ## give out the argument which is required for a reload. 
    124  
    125         ;; 
     126        ## Optional: Probe for the necessity of a reload, 
     127        ## give out the argument which is required for a reload. 
     128 
     129        ;; 
    126130    *) 
    127         echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" 
    128         exit 1 
    129         ;; 
     131        echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" 
     132        exit 1 
     133        ;; 
    130134esac 
    131135rc_exit 
    132136}}} 
    133137 
    134 == Web UI == 
     138== Web UI (deluge-web) == 
    135139 
    136140{{{ 
    137 #!sh 
    138141#! /bin/sh 
    139142# Copyright (c) 1995-2000 SuSE GmbH Nuernberg, Germany. 
     
    146149# 
    147150# /usr/sbin/deluge-webd 
     151# 
     152# FROM http://dev.deluge-torrent.org/wiki/UserGuide/InitScript/OpenSUSE 
    148153# 
    149154### BEGIN INIT INFO 
     
    151156# Required-Start: $local_fs $remote_fs 
    152157# Required-Stop: $local_fs $remote_fs 
    153 # Should-Start: $network 
     158# Should-Start: $network deluged 
    154159# Should-Stop: $network 
    155160 
     
    165170 
    166171DELUGED_WEB_USER="deluge" 
     172 
     173DELUGED_WEB_ARGS="-c /home/$DELUGED_WEB_USER/.config/deluge/ -f" # consult man deluge-web for more options 
     174 
     175PYTHON_EGG_CACHE=/home/$DELUGED_WEB_USER/.python-eggs 
    167176 
    168177. /etc/rc.status 
     
    183192    start) 
    184193         
    185         echo -n "Starting DELUGE-WEB daemon" 
    186         ## Start daemon with startproc(8). If this fails 
    187         ## the echo return value is set appropriate. 
    188  
    189         startproc -f -u $DELUGED_WEB_USER $DELUGED_WEB_BIN 
    190  
    191         # Remember status and be verbose 
    192         rc_status -v 
    193         ;; 
     194        echo -n "Starting DELUGE-WEB daemon" 
     195        ## Start daemon with startproc(8). If this fails 
     196        ## the echo return value is set appropriate. 
     197 
     198        export PYTHON_EGG_CACHE 
     199        startproc -f -l /var/log/deluge-web.log -u $DELUGED_WEB_USER $DELUGED_WEB_BIN $DELUGED_WEB_ARGS 
     200 
     201        # Remember status and be verbose 
     202        rc_status -v 
     203        ;; 
    194204    stop) 
    195         echo -n "Shutting down DELUGE-WEB daemon" 
    196         ## Stop daemon with killproc(8) and if this fails 
    197         ## set echo the echo return value. 
    198  
    199         killproc -TERM $DELUGED_WEB_BIN 
    200  
    201         # Remember status and be verbose 
    202         rc_status -v 
    203         ;; 
     205        echo -n "Shutting down DELUGE-WEB daemon" 
     206        ## Stop daemon with killproc(8) and if this fails 
     207        ## set echo the echo return value. 
     208 
     209        killproc -TERM $DELUGED_WEB_BIN 
     210 
     211        # Remember status and be verbose 
     212        rc_status -v 
     213        ;; 
    204214    try-restart) 
    205215        ## Stop the service and if this succeeds (i.e. the  
     
    220230        ;; 
    221231    force-reload|reload) 
    222         ## Signal the daemon to reload its config. Most daemons 
    223         ## do this on signal 1 (SIGHUP). 
    224  
    225         echo -n "Reload service DELUGED_WEB" 
    226  
    227         killproc -HUP $DELUGED_WEB_BIN 
     232        ## Signal the daemon to reload its config. Most daemons 
     233        ## do this on signal 1 (SIGHUP). 
     234 
     235        echo -n "Reload service DELUGED_WEB" 
     236 
     237        killproc -HUP $DELUGED_WEB_BIN 
    228238 
    229239        rc_status -v 
     
    231241        ;; 
    232242    status) 
    233         echo -n "Checking for service DELUGED_WEB " 
     243        echo -n "Checking for service DELUGED_WEB " 
    234244        ## Check status with checkproc(8), if process is running 
    235245        ## checkproc will return with exit status 0. 
     
    241251        # 3 - service not running 
    242252 
    243         checkproc $DELUGED_WEB_BIN 
    244  
    245         rc_status -v 
    246         ;; 
     253        checkproc $DELUGED_WEB_BIN 
     254 
     255        rc_status -v 
     256        ;; 
    247257    probe) 
    248         ## Optional: Probe for the necessity of a reload, 
    249         ## give out the argument which is required for a reload. 
    250  
    251         ;; 
     258        ## Optional: Probe for the necessity of a reload, 
     259        ## give out the argument which is required for a reload. 
     260 
     261        ;; 
    252262    *) 
    253         echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" 
    254         exit 1 
    255         ;; 
     263        echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" 
     264        exit 1 
     265        ;; 
    256266esac 
    257267rc_exit