venerdì, agosto 01, 2008

RHEL Centos Zope start scripts

- post<li> - Permalink

Ieri ho installato Zope su Centos 5.2 e mi sono fatto uno script di startup che usa zopectl partendo da quello fornito dal sito di Zope che però usa Zeocluster. Spero possa servire a qualcuno :D



Zope Start scripts



#!/bin/sh
# /etc/rc.d/init.d/zope
# Startup script for Zope
#
# chkconfig: 345 80 20
# description: Zope, a web application server
# this works as is for a default universal plone linux install
#

# Source function library.
. /etc/init.d/functions

RETVAL=0

#Da Cambiare con il percorso dell'istanza da eseguire
#To change to match the Zope istance
prog_path="/home/zope/istanza/bin/"

prog="zopectl"


start() {
echo -n $"Starting $prog: "
output=`$prog_path$prog start`
# the return status of zopectl is not reliable, we need to parse
# its output via substring match
if echo $output | grep -q "start"; then
# success
touch /var/lock/subsys/$prog
success
echo
RETVAL=0
else
# failed
failure
echo
RETVAL=1
fi
return $RETVAL
}#end start

stop() {
echo -n $"Stopping $prog: "
output=`$prog_path$prog stop`
# the return status of zopectl is not reliable, we need to parse
# its output via substring match
if echo $output | grep -q "stop"; then
# success
rm /var/lock/subsys/$prog
success
echo
RETVAL=0
else
# failed
failure
echo
RETVAL=1
fi
return $RETVAL
}

restart() {
stop
start
}

case "$1" in
start)
start
;;
stop)
stop
;;
status)
echo "Zope Server:"
output=`$prog_path$prog status`
echo $output
;;
restart)
restart
;;
condrestart)
[ -e /var/lock/subsys/$prog ] && restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
RETVAL=2
esac

exit $RETVAL


Una volta salvato dentro a



/etc/init.d



si può aggiungere ai servizi che partono in automatico allo startup con i seguenti comandi



>chkconfig --add zope

>chkconfig zope on


Inoltre è possibile richiamarlo con la seguente sintassi



 >service zope restart (o gli altri comandi)


Byez



Addetta ai sussidi: Occupazione?

Comicus: Filosofo impegnato.

Addetta: Cosa?

Comicus: Filosofo impegnato, io condenso il vapore delle umane esperienze in una essenziale e logica comprensione.

Addetta: Ah, insomma venditore di fumo.

1 commenti:

Anonimo ha detto...

ciao volevo segnalarti la presenza di un contest con in palio un samsung omnia i900 sul sito evaystyle...bisogna aprtecipare numerosi..aderisci anche te

Articoli correlati divisi per etichetta



Widget by Hoctro