I attached the rc scripts for tomcat5 and lprng here in case anybody
wants them, since I could upload them to the contrib area or the
src.rpms which contained them.

On Tue, 2004-09-21 at 12:26, David M. Fetter wrote:
> Well, I tried to upload the src rpms for lprng and tomcat5 but they were
> rejected in that form.  I uploaded the spec files only.  The rc scripts
> won't upload due to some filename rejection.  Not sure why the src rpms
> failed.  The rejection doesn't seem to indicate why.
> 
> On Tue, 2004-09-21 at 11:56, David M. Fetter wrote:
> > I also uploaded an lprng src rpm which includes and rc script and the
> > ifhp spec file.
-- 
David M. Fetter - UNIX Systems Administrator
Portland State University - www.oit.pdx.edu
"Only those who attempt the absurd can achieve the impossible."
[EMAIL PROTECTED]@/lib/openpkg/bash @l_prefix@/etc/rc
##
## rc.lprng -- Run-Commands for LPRng daemon
##

%config
    lprng_enable="$openpkg_rc_def"
    lprng_user="@l_musr@"
    lprng_group="@l_mgrp@"

%common
    [EMAIL PROTECTED]@/var/lprng/run/lprng.lock.*

    lprng_signal() {
        SIGNALTYPE=$1
        
        overall_retval=0
        for f in $lprng_pidfiles ; do

            #   catch fall-through case where no PID files are found
            [ "x${f}" = "[EMAIL PROTECTED]@/var/lprng/run/lprng.lock.*" ] && {
                return 1
            }

            [ -f $f ] && {
                pid=`cat $f`
                kill -${SIGNALTYPE} $pid
                single_retval=$?

                #   if non-success error code, record it
                [ $single_retval != 0 ] && overall_retval=$single_retval
            }

        done

        return $overall_retval
    }

%status -u @l_susr@ -o
    lprng_usable="unknown"
    lprng_active="no"
    rcService lprng enable yes && \
        lprng_signal 0 && lprng_active="yes"
    echo "lprng_enable=\"$lprng_enable\""
    echo "lprng_usable=\"$lprng_usable\""
    echo "lprng_active=\"$lprng_active\""

%start -u @l_susr@
    rcService lprng enable yes || exit 0
    rcService lprng active yes && exit 0
    @l_prefix@/sbin/lpd

%stop -u @l_susr@
    rcService lprng enable yes || exit 0
    rcService lprng active no && exit 0
    lprng_signal TERM
    rm -f $lprng_pidfiles 2>/dev/null || true

%restart -u @l_susr@
    rcService lprng enable yes || exit 0
    rcService lprng active no && exit 0
    rc lprng stop
    sleep 2
    rc lprng start

%daily -u @l_susr@
    rcService lprng enable yes || exit 0
#!/usr/local/lib/openpkg/bash /usr/local/etc/rc
##
##  rc.tomcat5 -- Run-Commands
##

%config
    tomcat5_enable="$openpkg_rc_def"
    tomcat5_home="/usr/local/libexec/tomcat5"
    tomcat5_log_prolog="true"
    tomcat5_log_epilog="true"
    tomcat5_log_numfiles="10"
    tomcat5_log_minsize="1M"
    tomcat5_log_complevel="9"

%common
    tomcat5_pidfile="/usr/local/var/tomcat5/log/tomcat.pid"
    tomcat5_signal () {
        [ -f $tomcat5_pidfile ] && kill -$1 `cat $tomcat5_pidfile`
    }

%status
    tomcat5_usable="unknown"
    tomcat5_active="no"
    rcService tomcat5 enable yes && \
        tomcat5_signal 0 && tomcat5_active="yes"
    echo "tomcat5_enable=\"$tomcat5_enable\""
    echo "tomcat5_usable=\"$tomcat5_usable\""
    echo "tomcat5_active=\"$tomcat5_active\""

%start
    rcService tomcat5 enable yes || exit 0
    rcService tomcat5 active yes && exit 0
    JAVA_HOME="$java_home"; export JAVA_HOME
    CATALINA_HOME="$tomcat5_home"; export CATALINA_HOME
    CATALINA_OPTS=""; export CATALINA_OPTS
    CATALINA_PID="$tomcat5_pidfile"; export CATALINA_PID
    DAEMON_HOME="${CATALINA_HOME}/bin"; export DAEMON_HOME
    TOMCAT_USER=www; export TOMCAT_USER
    TMP_DIR=/var/tmp; export TMP_DIR
    
CLASSPATH=${JAVA_HOME}/lib/tools.jar:${CATALINA_HOME}/bin/commons-daemon.jar:${CATALINA_HOME}/bin/bootstrap.jar;
 export CLASSPATH
        #
    # Start Tomcat
    #
    $DAEMON_HOME/jsvc \
    -user $TOMCAT_USER \
    -home $JAVA_HOME \
    -Dcatalina.home=$CATALINA_HOME \
    -Djava.io.tmpdir=$TMP_DIR \
    -outfile $CATALINA_HOME/logs/catalina.out \
    -errfile '&1' \
    $CATALINA_OPTS \
    -cp $CLASSPATH \
    org.apache.catalina.startup.Bootstrap
    #
    # To get a verbose JVM
    #-verbose \
    # To get a debug of jsvc.
    #-debug 
 
%stop
    rcService tomcat5 enable yes || exit 0
    rcService tomcat5 active no && exit 0
    JAVA_HOME="$java_home"; export JAVA_HOME
    CATALINA_HOME="$tomcat5_home"; export CATALINA_HOME
    ps -ef|grep tomcat5|grep -v grep|awk '{print $2}'|xargs -t kill 1&2>/dev/null
    rm -f $tomcat5_pidfile 2>/dev/null || true

%restart
    rcService tomcat5 enable yes || exit 0
    rcService tomcat5 active no && exit 0
    rc tomcat5 stop
    rc tomcat5 start

%daily
    rcService tomcat5 enable yes || exit 0

    #   rotate logfile
    shtool rotate -f \
        -n ${tomcat5_log_numfiles} -s ${tomcat5_log_minsize} -d \
        -z ${tomcat5_log_complevel} -o www -g alummail -m 660 \
        -P "${tomcat5_log_prolog}" \
        -E "${tomcat5_log_epilog} && rc tomcat5 restart" \
        $CATALINA_HOME/logs/catalina.out

%env
    rcService tomcat5 enable yes || exit 0
    CATALINA_HOME="$tomcat5_home"
    export CATALINA
    export CATALINA_HOME

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to