Changeset 2303 in /cluster/svnroot


Ignore:
Timestamp:
Apr 1, 2010 3:45:07 PM (11 years ago)
Author:
fitz
Message:

(#454) Scrapping monitor as it makes things unstable

Location:
bccd-ng/branches/fitz-devel/trees
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • bccd-ng/branches/fitz-devel/trees/etc/init.d/mpd

    r2193 r2303  
    33### BEGIN INIT INFO
    44# Provides:             mpd
    5 # Required-Start:
     5# Required-Start:       snmpd
    66# Required-Stop:       
    77# Default-Start:        2 4 5
     
    2525CFGFILE=/etc/mpd.conf
    2626PORTFILE=/etc/snmp/mpd.port
    27 MPDMON=/bin/bccd-mpdmon
    2827NCPUS=`grep ^processor /proc/cpuinfo | wc -l`
    2928
     
    4342        if test -f $PORTFILE; then
    4443                PORT=`cat $PORTFILE`
    45                 /bin/nc -z `hostname` $PORT
     44                /bin/nc -z localhost $PORT
     45                # unset PORT if it's now used
    4646                test $? == 0 && unset PORT
    4747        fi
     
    5454                # Test availability of that port and keep trying
    5555                # until we get an open one
    56                 /bin/nc -z `hostname` $PORT
     56                /bin/nc -z localhost $PORT
    5757                while [ $? -eq 0 ]; do
    5858                        PORT=$(($RANDOM+32767))
    59                         /bin/nc -z `hostname` $PORT
     59                        /bin/nc -z localhost $PORT
    6060                done
    6161
     
    100100
    101101case $1 in
    102         mon-start)
     102        start)
    103103                test $UID == 0 || { log_failure_msg "Must be root!" && exit 4; }
    104104
     
    110110                status=$?
    111111
    112                 # Start monitor, if it's not already running
    113                 # in case MPD ever crashes or gets stranded
    114                 mon=`pidof -x $MPDMON`
    115                 test $mon || { nohup $MPDMON &> /dev/null & }
    116 
    117112                log_progress_msg "mpd"
    118113                log_end_msg $status
    119114                ;;
    120         start)
    121                 $0 mon-start
    122                 ;;
    123         mon-stop)
     115        stop)
    124116                test $UID == 0 || { log_failure_msg "Must be root!" && exit 4; }
    125117
    126118                $0 status &> /dev/null
    127                 status=$?
    128                 test $status != 0 && { log_success_msg "No MPD server running" && exit 0; }
     119                test $? != 0 && { log_success_msg "No MPD server running" && exit 0; }
    129120
    130121                log_daemon_msg "Stopping MPD server"
     
    139130                log_end_msg $status
    140131                ;;
    141         stop)
    142                 $0 mon-stop
    143                 kill `pidof -x $MPDMON` &> /dev/null
    144                 ;;
    145         restart | force-reload)               # restart as called by users
     132        restart | force-reload)
    146133                $0 stop; sleep 1; $0 start
    147                 ;;
    148         mon-restart)                          # restart as called by $MPDMON
    149                 $0 mon-stop; sleep 1; $0 mon-start
    150134                ;;
    151135        status)
Note: See TracChangeset for help on using the changeset viewer.