Startup script help
Matthew Carpenter
matt
Tue Dec 28 17:06:01 PST 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Chong Yu Meng wrote:
| 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.
Congrats. Writing your own startup scripts is definitely graduating
from one grade to the next! No flames here.
| 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 "&" has to come after the redirections.
|
| 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
|
_______________________________________________
Linux-users mailing list
Linux-users at linux-sxs.org
http://mail.linux-sxs.org/cgi-bin/mailman/listinfo/linux-users
Need to chat further on this subject? Check out #linux-users on
irc.linux-sxs.org !
- --
Matthew Carpenter
matt at eisgr.com http://www.eisgr.com/
Enterprise Information Systems
* Network Server Appliances
* Security Consulting, Incident Handling & Forensics
* Network Consulting, Integration & Support
* Web Integration and E-Business
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFB0dlZso9lqh4MragRAr3HAKCKZ5SyXAnmdYt9MnL8P+x5WhMkVACfcZEW
8fXYJ++v72rGIbRK2RiP8sM=
=Y1pE
-----END PGP SIGNATURE-----
More information about the Linux-users
mailing list