Startup script help

Chong Yu Meng chongym
Tue Dec 28 05:00:14 PST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi All,

I'm trying to write my first RedHat/Fedora-style startup script (no
flames, please !) for IBM's Cloudscape database (now called Apache
Derby). It works for the most part, but I need clarification on a few
things. The script is appended at the end of this email.

1. I googled about and someone was saying that the script needed to
follow a certain format at the beginning of the file, in order for
chkconfig to recognize it as a valid startup script. The line that
puzzles me is :

# chkconfig: 345 95 05

I understand that the first 3 numbers (345) refer to the run-levels, but
what are the other numbers (95 05)? I copied this off someone else's
script, so I'm not even sure if these numbers are appropriate to Cloudscape!

2. I am trying to suppress the response messages after the Cloudscape
database is started up and/or shutdown, so I do "> /dev/null 2>&1". I've
seen this is several scripts, and I thought this would work, but it does
not -- the response messages are still displaying. I think I may have
misunderstood the purpose of "> /dev/null 2>&1". Can someone tell me
what this is supposed to do, and how I can properly suppress messages?

The script is shown below:


#!/bin/bash
#
# Cloudscape startup script - Version 0.0.1

# chkconfig: 345 95 05

# description: Script for starting/stopping Cloudscape

# processname : cloudscape

# NOTES:
#
# This script is specifically for Fedora Core systems.
#

######################################################

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

# See how we are called
case "$1" in

~        start)
~                # Set CLOUDSCAPE_INSTALL
~                CLOUDSCAPE_INSTALL=/opt/ibm/Cloudscape_10.0
~                # Set CLASSPATH
~                [ -z "$CLASSPATH" ] && {
~                        .
"$CLOUDSCAPE_INSTALL"/frameworks/NetworkServer/bin/setNetworkServerCP.ksh
~                }
~                # Start Cloudscape as network server on port 1368
~                action "Starting Cloudscape: " /bin/true
~                java org.apache.derby.drda.NetworkServerControl start -p
1368 & > /dev/null 2>&1

~                echo
~                ;;
~        stop)
~                # Set CLOUDSCAPE_INSTALL
~                CLOUDSCAPE_INSTALL=/opt/ibm/Cloudscape_10.0
~                # Set CLASSPATH
~                [ -z "$CLASSPATH" ] && {
~                        .
"$CLOUDSCAPE_INSTALL"/frameworks/NetworkServer/bin/setNetworkServerCP.ksh
~                }
~                # Stop Cloudscape network server
~                action "Stopping Cloudscape: " /bin/true
~                java org.apache.derby.drda.NetworkServerControl shutdown
- -p 1368 & > /dev/null 2>&1

~                echo
~                ;;
~        restart)
~                action "Restarting Cloudscape: " /bin/true
~                $0 stop
~                $0 start

~                echo
~                ;;
~        *)
~                echo "Usage: $0 {start|stop|restart}"
~                exit 1
esac


- --
~ --------------------------------------
~ Pascal Chong

~ Visit me at : http://cymulacrum.net

~ Anyone who uses the phrase "easy as taking candy from a baby" has never
~ tried taking candy from a baby.
~                -- Robin Hood

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFB0TAbmVdpiRJSldgRArefAKDShNws/fNlmeHg+okztbFeILGMKgCg0f9J
c2SST7QfGfT9Aa5KZrQMBsY=
=9cOR
-----END PGP SIGNATURE-----


More information about the Linux-users mailing list