| Advertise on warmetal.nl! Click for more information about advertising here. |
Did you find this website useful? Did I save you a lot of time? |
|
Allthough I thought RC scripts were pretty simple I ran into some scripts yesterday that were so not rc.scripts, but configured for them anyway. The point was, they didn't had an start/stop parameter defined…
So, how do rc.scripts work:
#!/bin/ksh # Created by Sjoerd Hooft # Added on 5 November 2010 ### Script Variables APPDIR=/opt/sft/product/bin APPNAME=product RUN_USER=appuser export JAVA_HOME=/usr/java5_64 case "$1" in start ) echo "Starting the ${APPNAME} Application" su $RUN_USER -c ${APPDIR}/startup.sh ;; stop ) echo "stopping the ${APPNAME} Application" su $RUN_USER -c ${APPDIR}/shutdown.sh ;; * ) echo "Usage: $0 COMMAND" echo "---------------------------" echo "start - Start ${APPNAME} instance in ${APPDIR}" echo "stop - Stop ${APPNAME} instance in ${APPDIR}" echo exit 1 esac
sjoerd@db:/etc/rc.d/rc2.d>sudo ln -s /etc/rc.oracle S10oracle sjoerd@db:/etc/rc.d/rc2.d>sudo ln -s /etc/rc.oracle K90oracle
:rc file: /R-C fi:l/ n. [UNIX: from `runcom files' on the {CTSS} system ca.1955, via the startup script= `/etc/rc'] Script file containing startup instructions for an application program (or an entire operating system), usually a text file containing commands of the sort that might have been invoked manually once the system was running but are to be executed automatically each time the system starts up. See also {dotfile}, {profile} (sense 1).
Discussion