Ga naar inhoud


dorus43

Lid
  • Items

    229
  • Registratiedatum

  • Laatst bezocht

Community antwoorden

  1. dorus43's bericht in Script file: Foutmelding in update-rc.d (Debian) werd gemarkeerd als het antwoord   
    Opgelost, Ik heb op 
      http://linuxsat-support.com/showthread.php?t=71603    
    een beter script file gevonden en deze gaf geen foutmelding
     de nieuw  gebruikte oscam script is:
     
    # OSCam Start/Stop Script
    #
    ### BEGIN INIT INFO
    # Provides:          OSCam
    # Required-Start:    
    # Required-Stop:     
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: Start daemon at boot time
    # Description:       Enable OSCam service.
    ### END INIT INFO
    #
    # USER SETUP ###############################################
    # ----------------------------------------------------------
    # Path to the camd binaries - without trailing slash!
    # Example: camd_path='/var/emu'
    camd_path='/usr/bin'
    # ----------------------------------------------------------
    # Path to the camd configuration files - without trailing slash!
    # Example: camd_c_path='/var/keys'
    camd_c_path='/usr/local/etc'
    # ----------------------------------------------------------
    # CAMD PROCESS NAME
    camd_ps_oscam='oscam'
    # ----------------------------------------------------------
    # Max time in seconds before sending killall SIGKILL to CAMD - default 5
    camd_max_killtime=5
    # ----------------------------------------------------------
    # CAMD logfile
    camd_logfile='/var/log/oscam/oscam.log'
    #camd_logfile='/dev/null' # <-- logging off
    # ----------------------------------------------------------
    # CAMD START COMMAND
    camd_start_oscam="$camd_path/$camd_ps_oscam -c $camd_c_path"
    # END USER SETUP ###########################################

    # PRIVATE VARs *********************************************
    hr='------------------------------------------------------------'

    # FUNCTIONS ************************************************
    fStop() {
        echo "$hr" >> $camd_logfile
        echo `date`": Stopping $1..." >> $camd_logfile
        if ! pidof $1 > /dev/null; then
            echo `date`": $1 is not running" >> $camd_logfile
        else
            echo `date`": Send kill SIGTERM to $1" >> $camd_logfile
            kill -15 $(pidof $1) >> $camd_logfile 2>&1
            sleep 1
            if pidof $1 > /dev/null; then
                i=$camd_max_killtime
                while expr $i != 0 > /dev/null; do
                    if pidof $1 > /dev/null; then
                        echo `date`": Waiting max $i seconds before sending kill SIGKILL to $1..." >> $camd_logfile
                    else
                        echo `date`": $1 successfully killed" >> $camd_logfile
                        break
                    fi
                    i=`expr $i - 1`
                    sleep 1
                done
            else
                echo `date`": $1 successfully killed" >> $camd_logfile
            fi
            if pidof $1 > /dev/null; then
                echo `date`": Sending killall SIGKILL to $1!" >> $camd_logfile
                killall -9 $1 >> $camd_logfile 2>&1
            fi
        fi
    }

    fStart() {
        if pidof $1 > /dev/null; then
            fStop $1
        fi
        echo "$hr" >> $camd_logfile
        echo `date`": Starting $1..." >> $camd_logfile
        camd_start=$(eval echo \${"camd_start_$1"})
        echo `date`": $camd_start" >> $camd_logfile
        $camd_start > /dev/null 2>&1 &
        sleep 1
        if pidof $1 > /dev/null; then
            echo `date`": $1 successfully started" >> $camd_logfile
        else
            echo `date`": Could not start $1!" >> $camd_logfile
        fi
    }

    # BY PARAMETER *********************************************
    case "$1" in
        'stop')
            fStop "$camd_ps_oscam"
        ;;
        'start'|'restart'|'reload')
            fStart "$camd_ps_oscam"
        ;;
        *)
            msg='Usage: /etc/init.d/oscam {start|stop|restart|force-reload}'
            echo "$msg"
            echo "$hr" >> $camd_logfile
            echo `date`": $msg" >> $camd_logfile
            exit 1
        ;;
    esac
    exit 0
×
×
  • Nieuwe aanmaken...