1. Diese Seite verwendet Cookies. Wenn du dich weiterhin auf dieser Seite aufhältst, akzeptierst du unseren Einsatz von Cookies. Weitere Informationen

oscam watchdog 2 instanzen Ubuntu

Dieses Thema im Forum "Oscam Talk Archiv" wurde erstellt von Mufamba, 6. November 2013.

  1. Mufamba
    Offline

    Mufamba Hacker

    Registriert:
    2. September 2009
    Beiträge:
    366
    Zustimmungen:
    64
    Punkte für Erfolge:
    28
    hab hier zwei watchdogs für meine zwei instanzen am laufen, allerdings wird nur ein watchdog ausgeführt.


    kann evtl. jemand helfen!?


    System ist Ubuntu 13.04 (GNU/Linux 3.8.0-32-generic i686)


    watchdogoscam1:
    Code:
    #!/bin/sh
    while sleep 60
    do
    process=`ps auxwww | grep oscam.x86 | grep -v grep | awk '{print $1}'`
    if [ -z "$process" ]; then
    echo "Couldn't find oscam running. Restarting server-binary" >> /var/log/oscam/oscam.check
    nohup /var/emu/oscam.x86 -b -c /var/etc >> /var/log/oscam/watchdogoscam.log &
    else
    echo "oscam is still OK!" >> /var/log/oscam/oscam.check
    fi
    done
    

    watchdogoscam2:
    Code:
    #!/bin/sh
    while sleep 60
    do
    process=`ps auxwww | grep oscam2.x86 | grep -v grep | awk '{print $1}'`
    if [ -z "$process" ]; then
    echo "Couldn't find oscam2 running. Restarting server-binary" >> /var/log/oscam/oscam2.check
    nohup /var/emu/oscam2.x86 -b -c /var/etc2 >> /var/log/oscam/watchdogoscam2.log &
    else
    echo "oscam2 is still OK!" >> /var/log/oscam/oscam2.check
    fi
    done
    

    hier noch die start/stop scripts der beiden oscams:


    oscam1:
    Code:
    #!/bin/bash
    #/var/emu/oscam.x86 -b -c /var/etc/oscam
    #
    CAMNAME="Oscam Server" 
    # end
    # This method starts Oscam
    start_cam () 
    { 
    pkill -9 oscam.x86 
    sleep 2
    /var/emu/oscam.x86 -b -c /var/etc &
    } 
    # This method stops Oscam
    stop_cam () 
    { 
    pkill -9 oscam.x86 
    } 
    case "$1" in 
    start) 
    echo "[SCRIPT] $1: $CAMNAME" 
    start_cam 
    ;; 
    stop) 
    echo "[SCRIPT] $1: $CAMNAME" 
    stop_cam 
    ;; 
    restart) 
    echo "Restaring $CAMNAME" 
    stop_cam 
    sleep 7
    start_cam 
    ;; 
    *) 
    "$0" stop 
    exit 1 
    ;; 
    esac 
    exit 0
    


    oscam2:
    Code:
    #!/bin/bash
    #/var/emu/oscam2.x86 -b -c /var/etc2
    #
    CAMNAME="Oscam Server" 
    # end
    # This method starts Oscam
    start_cam () 
    { 
    pkill -9 oscam2.x86 
    sleep 2
    /var/emu/oscam2.x86 -b -c /var/etc2 &
    } 
    # This method stops Oscam
    stop_cam () 
    { 
    pkill -9 oscam2.x86 
    } 
    case "$1" in 
    start) 
    echo "[SCRIPT] $1: $CAMNAME" 
    start_cam 
    ;; 
    stop) 
    echo "[SCRIPT] $1: $CAMNAME" 
    stop_cam 
    ;; 
    restart) 
    echo "Restaring $CAMNAME" 
    stop_cam 
    sleep 7
    start_cam 
    ;; 
    *) 
    "$0" stop 
    exit 1 
    ;; 
    esac 
    exit 0
    

    ausserdem die rc.local:
    Code:
    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.
    /etc/init.d/oscam start &
    /etc/init.d/oscam2 start &
    /etc/init.d/watchdogoscam1
    /etc/init.d/watchdogoscam2
    
    
    exit 0
    
     
    Zuletzt von einem Moderator bearbeitet: 6. November 2013
    #1

Diese Seite empfehlen