On Tue, 11 Dec 2001, Cindy Ballreich wrote:

> I suppose that this is really a Xvfb or even a Linux question, but since it
> directly relates to Cocoon I hope you'll allow me to ask it here. I've
> tried linux.redhat.misc with no success.
>
> I have a very basic RedHat 7.0 web server (Apache 1.3.20) and I want to run
> Cocoon 2.0 with Tomcat 3.3. Apparently, I also need to run Xvfb in order
> for Cocoon to work properly. I would very much like to start Xvfb at boot
> time along with all of the other web services. I've written an init.d
> script to do this. This script works very well from the command line, but
> for some reason it won't work at boot time. Perhaps Xvfb requires a service
> that isn't running when it tries to start? I was wondering if anyone might
> be doing this successfully and if they'd mind sharing their init.d script.
> I'd also appreciate being pointed to any documentation that might explain
> what I'm doing wrong.
>
> My current script was accepted by chkconfig and all of the rc.d links are
> present. It works great from the command line and *appears* to work at boot
> time (I get the "starting" message and the result is "OK"), but once the
> system finishes booting and I log on there is no instance of Xvfb running.
>
> Any advice would be greatly appreciated.
>
> Here is the script that I'm currently using...
>
>[code]

You want perhaps look on the fbset service from the suse dist.
I have this file attached on this mail. [Sorry for the traffic]

#! /bin/bash
# Copyright (c) 1995-2000 SuSE GmbH Nuernberg, Germany.
#
# Author: Kurt Garloff <[EMAIL PROTECTED]>
#
# /etc/init.d/fbset
#
#   and symbolic its link
#
# /usr/sbin/rcfbset
#
# System startup script for the nessus backend nessusd
#
### BEGIN INIT INFO
# Provides: FOO
# Required-Start: $remote_fs
# Required-Stop:  $remote_fs
# Default-Start:  1 2 3 5
# Default-Stop:   0 6
# Description:    Framebuffer setup
### END INIT INFO

# Source SuSE config
. /etc/rc.config

# Determine the base and follow a runlevel link name.
base=${0##*/}
link=${base#*[SK][0-9][0-9]}

# Force execution if not called by a runlevel directory.
#test $link = $base && START_FBSET=yes
#test "$START_FBSET" = yes || exit 0
test -z "$FB_MODULES" -a -z "$FBSET_PARAMS" && exit 0

FBSET_BIN=/usr/sbin/fbset
test ! -z "$FB_MODULES" -o -x $FBSET_BIN || exit 5

# Shell functions sourced from /etc/rc.status:
#      rc_check         check and set local and overall rc status
#      rc_status        check and set local and overall rc status
#      rc_status -v     ditto but be verbose in local rc status
#      rc_status -v -r  ditto and clear the local rc status
#      rc_failed        set local and overall rc status to failed
#      rc_failed <num>  set local and overall rc status to <num><num>
#      rc_reset         clear local rc status (overall remains)
#      rc_exit          exit appropriate to overall rc status
. /etc/rc.status

# First reset status of this service
rc_reset

# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - insufficient privilege
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
# 
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
# considered a success.

case "$1" in
    start)
        echo -n "Framebuffer setup: "
        ## Start daemon with startproc(8). If this fails
        ## the echo return value is set appropriate.

        if test ! -z "$FB_MODULES"; then
                # $FB_MODULES needs parsing: It might contain several modules
                # and module parameters. We identify params by the = sign.
                unset mod modpar
                for par in $FB_MODULES; do 
                        case $par in
                            *=*) 
                                modpar="$modpar $par"
                                ;;
                            *) 
                                if test ! -z "$mod"; then
                                        echo -n "$mod "
                                        modprobe $mod $modpar
                                        rc_status
                                fi
                                unset modpar
                                mod=$par
                                ;;
                        esac
                done
                echo -n "$mod "
                modprobe $mod $modpar
                rc_status
        fi

        if test ! -z "$FBSET_PARAMS"; then
                if test -x $FBSET_BIN; then
                        mode=`echo $FBSET_PARAMS | sed -e 's/^-[^ ]*//' -e 's/ -[^ 
]*//g'`
                        echo -n "$mode "
                        $FBSET_BIN $FBSET_PARAMS
                        rc_status
                else
                        echo -n "fbset not installed "
                        rc_failed 5
                fi
        fi

        # Remember status and be verbose
        rc_status -v
        ;;
    stop)
        # We don't unload the fb driver modules; this could be risky
        # and will probably fail anyway
        ;;
    try-restart)
        ## Stop the service and if this succeeds (i.e. the 
        ## service was running before), start it again.
        ## Note: try-restart is not (yet) part of LSB (as of 0.7.5)
        $0 status >/dev/null &&  $0 restart

        # Remember status and be quiet
        rc_status
        ;;
    restart)
        ## Stop the service and regardless of whether it was
        ## running or not, start it again.
        $0 start

        # Remember status and be quiet
        rc_status
        ;;
    force-reload)
        ## Signal the daemon to reload its config. Most daemons
        ## do this on signal 1 (SIGHUP).
        ## If it does not support it, restart.
        $0 try-restart
        rc_status
        ;;
    reload)
        $0 try-restart
        rc_status
        ;;
    status)
        echo -n "Checking for framebuffer setup: "
        ## Check status with checkproc(8), if process is running
        ## checkproc will return with exit status 0.

        # Status has a slightly different for the status command:
        # 0 - service running
        # 1 - service dead, but /var/run/  pid  file exists
        # 2 - service dead, but /var/lock/ lock file exists
        # 3 - service not running
        
        if test ! -z "$FB_MODULES"; then
                # $FB_MODULES needs parsing: It might contain several modules
                # and module parameters. We identify params by the = sign.
                for par in $FB_MODULES; do
                        case $par in
                            *=*) 
                                ;;
                            *) 
                                if test ! -z "$par"; then
                                        if test -z "`lsmod | grep $par`";
                                                then echo -n '!'"$par "
                                                rc_failed 3
                                        else
                                                echo -n "$par "
                                        fi
                                fi
                                ;;
                        esac
                done
        fi
        
        if test -x $FBSET_BIN; then
                mode=`$FBSET_BIN | grep -e "^mode" | sed 's/[^"]*"\([^"]*\)".*/\1/'`
                rc_status
                echo -n "$mode "
        fi
                
        rc_status -v
        ;;
    probe)
        ## Optional: Probe for the necessity of a reload,
        ## give out the argument which is required for a reload.
        test -r /proc/uptime -a -x /bin/date -a ! -z "$FBSET_PARAMS" -a -x $FBSET_BIN 
|| exit 0
        boottm=$[`date -u +%s`-`cat /proc/uptime|sed 's/\([^\.]*\).*/\1/'`]
        test $boottm -lt `date -r /etc/fb.modes -u +%s` -o $boottm -lt `date -r 
$FBSET_BIN -u +%s` && echo reload
        ;;
    *)
        echo "Usage: $0 
{start|stop|status|try-restart|restart|force-reload|reload|probe}"
        exit 1
        ;;
esac
rc_exit
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to