Overview

Pen

http://siag.nu/pen/howto.shtml

Init-script-example:

#!/bin/sh
#
# startup script for pen
#

PENBIN=/usr/local/bin/pen
LOGFILE=/var/log/pen_ws_all_80_443.log
PIDFILE1=/var/run/pen_ws1_80.pid
PIDFILE2=/var/run/pen_ws2_80.pid
TIMEOUT=14400
CONTROLPORT=8812
CHROOTDIR=/chroot/pen

LBSERVER1=10.6.3.52:80
LBSERVER2=10.6.3.53:80
LBSERVER3=10.6.3.54:80
LBSERVER11=10.6.3.52:443
LBSERVER22=10.6.3.53:443
LBSERVER33=10.6.3.54:443

SERVER1=10.6.11.23:80
SERVER2=10.6.11.23:443

case "$1" in

    start)
    if [ -x "$PENBIN" ] ; then
        echo -n "Starting pen: "
        $PENBIN -T $TIMEOUT -C $CONTROLPORT -S 2 -X -l $LOGFILE -p $PIDFILE1 $LBSERVER1 $SERVER1 $SERVER2
        $PENBIN -T $TIMEOUT -C $CONTROLPORT -S 2 -X -l $LOGFILE -p $PIDFILE11 $LBSERVER11 $SERVER1 $SERVER2
        echo -e "OK"
        exit
    fi
    ;;

    stop)
    echo -n "Stopping pen: "
    kill `cat $PIDFILE1`
    kill `cat $PIDFILE11`
    echo -e "OK"
    exit
    ;;

    restart)
    $PENBIN stop
    $PENBIN start
    exit
    ;;

    status)
    if [ -f "$PIDFILE" ]; then
        read pen_pid < $PIDFILE
      if kill -0 "$pen_pid" 2>/dev/null ; then
        echo -e "PEN running ("$pen_pid")"
        exit
      else
        echo -e "PEN is not running, but PID file exists"
        exit 1
      fi
    else
        echo -e "PEN is not running"
        exit 1
      fi
    ;;


    *)
    echo "usage: $0 { start | stop | restart | status }" >&2
    exit 1
    ;;

esac
loadbalancing/pen.txt · Last modified: 2017/12/09 01:19 by 127.0.0.1
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki