Download Firefox: WindowsMac OS X
logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: Re: New Emilda install: msg#00002

Subject: Re: Re: New Emilda install
Scott Leafe wrote:


I am still working on a suitable rc.zebra file to startup zebrasrv but I can start the service manually and emilda seems to function just fine.

you can have mine. runs on archlinux, but needs little editing on other 
dirstris too

/etc/conf.d/idzebra

--------------------------------------------------------------------
ZEBRA_SERVER_TAGS=( emilda )

##
## SEE 'man yaz-ztest' :
## automatically configured in /etc/rc.d/idzebra :
##
## -p /var/idzebra/<tag>/zebrasrv.pid
## -l /var/idzebra/<tag>/zebrasrv.log
## -T -D
## -d idzebra_<tag> (/etc/hosts.allow)
## -w ZEBRASRV_<tag>_ROOTDIR
## -c ZEBRASRV_<tag>_CONFFILE (default: zebra.cfg)
## ZEBRASRV_<tag>_LISTENON

## e.g. <tag> == emilda

# MUST BE SPECIFIED !!!
#
#ZEBRASRV_emilda_ROOTDIR="/home/idzebra/emilda"
#ZEBRASRV_emilda_LISTENON="tcp:localhost:3000"
# OPTIONAL
#ZEBRASRV_emilda_MOREARGS="-v debug -u httpd -C /etc/ssl/grass_httpd_pem"

###

ZEBRASRV_emilda_ROOTDIR="/home/emilda/idzebra"
ZEBRASRV_emilda_LISTENON="tcp:localhost:3000"
ZEBRASRV_emilda_MOREARGS="-v debug -u httpd"
--------------------------------------------------------------------

/etc/rc.d/idzebra

--------------------------------------------------------------------
#!/bin/bash

#define missing display functions void
for i in rm_daemon add_daemon stat_busy stat_fail stat_done
do
 if [ "`type -t $i`" != "function" ] ; then
   eval $i \(\) \{ : \; \}
 fi
done

DAEMON=`basename $0`
[ "$DAEMON" != "" ] || exit

# source application-specific settings
[ -f /etc/conf.d/$DAEMON ] || exit 0
. /etc/conf.d/$DAEMON


# ==>> required
DAEMONDESC="IDZebra Server"
DAEMONBIN=/usr/bin/zebrasrv

[ -x $DAEMONBIN ] || exit
. /etc/rc.conf
. /etc/rc.d/functions

argx="$1"; shift
eval argi\=\( "${ZEBRA_SERVER_TAGS[@]}" \)
if [ $# -ge 1 ]
then
 i=-1; argi=()
 while [ $# -ge 1 ]; do
   for j in "${ZEBRA_SERVER_TAGS[@]}"
   do
     [ "$j" = "" ] && continue
     [ "$1" != "$j" ] && continue
     i=$(($i+1)); argi[$i]="$1"
   done
   shift
 done
fi
case "$argx" in
 start)
   if [ ${#argi[*]} -ne 0 ]
   then
     ok=1
     for i in "${argi[@]}"
     do
       [ -d /var/idzebra/$i ] || continue
       eval listenon\=\"\$ZEBRASRV_${i}_LISTENON\"
       [ "$listenon" != "" ] || continue
       eval zebraroot\=\"\$ZEBRASRV_${i}_ROOTDIR\"
       [ "$zebraroot" != "" ] || continue
       eval zebraconf\=\"\$ZEBRASRV_${i}_CONFFILE\"
       [ "$zebraconf" = "" ] && zebraconf=zebra.cfg
       if [ -f /var/idzebra/$i/zebrasrv.pid ]; then
         stat_busy "(Re?)Starting $DAEMONDESC $i"
         kill `cat /var/idzebra/$i/zebrasrv.pid` >/dev/null 2>&1
         rm -f /var/idzebra/$i/zebrasrv.pid
       else
         stat_busy "Starting $DAEMONDESC $i"
       fi
       rm -f /var/idzebra/$i/zebrasrv.log

       eval startit\=\"$DAEMONBIN -T -D -p /var/idzebra/$i/zebrasrv.pid \
         -l /var/idzebra/$i/zebrasrv.log -d idzebra_$i -w $zebraroot \
         -c $zebraconf \$ZEBRASRV_${i}_MOREARGS $listenon\"

       echo $startit
       eval $startit \>/dev/null 2\>\&1
       [ -f /var/idzebra/$i/zebrasrv.pid ] && ok=0
     done
     if [ $ok -eq 0 ]; then
       add_daemon $DAEMON
       stat_done
       exit 0
     fi
     rm_daemon $DAEMON
     stat_fail
   fi
   ;;
 stop)
   if [ ${#argi[*]} -ne 0 ]
   then
     ok=1
     for i in "${argi[@]}"
     do
       if [ -f /var/idzebra/$i/zebrasrv.pid ]; then
         stat_busy "Stopping $DAEMONDESC $i"
         kill `cat /var/idzebra/$i/zebrasrv.pid` >/dev/null 2>&1
         rm -f /var/idzebra/$i/zebrasrv.pid
       else
         stat_busy "$DAEMONDESC $i apparently not started"
       fi
     done
     rm_daemon $DAEMON
     stat_done
   fi
   ;;
 restart)
   if [ ${#argi[*]} -ne 0 ]
   then
     $0 stop  "${argi[@]}"
     $0 start "${argi[@]}"
   fi
   ;;
 *)
   echo "usage: $0 {start|stop|restart} [ <tag> ... ]"
esac
exit 0
--------------------------------------------------------------------


<Prev in Thread] Current Thread [Next in Thread>