07-05-2012 02:48 PM
I really like the SAS BI environment startup script that is built for me in my BI server config directory (a file named sas.servers). It is very convenient to add this to my Solaris startup directory.
However, I'd like to also subsequently start my JBOSS server automatically. As of today, whenever the server reboots, I must manually restart JBOSS by logging on as the "sas" user and executing the SASServer1.sh script.
Can the "sas.servers" script be modified somehow so it will start JBOSS automatically? Or is there some other solution?
I do know that JBOSS needs to be started after "SAS Remote Services" is up. I'm just looking for a way to get everything up and running automatically after a reboot.
07-06-2012 08:25 PM
The approach I take, rather than modify the SAS supplied scripts (or script generator) to handle third party software, is to have a wrapper script which calls sas.servers and then launches JBoss. When shutting down, it stops JBoss and then stops sas.servers. To clarify here's a simple init script I use on a single machine Linux development environment.
#!/bin/bash ### BEGIN INIT INFO # Provides: saslev3 # Required-Start: $local_fs $remote_fs $network $syslog # Required-Stop: $local_fs $remote_fs $network $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start/stop SAS Lev3 ### END INIT INFO . /lib/lsb/init-functions SERVICE_DESC="SAS Lev3" SAS_CFG_DIR=/opt/ebiedieg/Lev3 SERVICE_SCRIPT=$SAS_CFG_DIR/sas.servers JBOSS_SCRIPT=/opt/init.d/jbosslev3 case "$1" in start) echo "Starting $SERVICE_DESC services ..." echo "... starting SAS services for $SERVICE_DESC" $SERVICE_SCRIPT $1 echo "... starting JBoss service for $SERVICE_DESC" $JBOSS_SCRIPT $1 echo "Finished starting $SERVICE_DESC services." ;; stop) echo "Stopping $SERVICE_DESC services ..." echo "... stopping JBoss service for $SERVICE_DESC" $JBOSS_SCRIPT $1 sleep 30 echo "... stopping SAS services for $SERVICE_DESC" $SERVICE_SCRIPT $1 echo "Finished stopping $SERVICE_DESC services." ;; restart) echo "Restarting $SERVICE_DESC services ..." $0 stop sleep 30 $0 start echo "Finished restarting $SERVICE_DESC services." ;; force-reload) $0 restart ;; status) echo "Status check for $SERVICE_DESC services ..." echo "... status of SAS services for $SERVICE_DESC" $SERVICE_SCRIPT $1 echo "... status of JBoss service for $SERVICE_DESC" $JBOSS_SCRIPT $1 echo "Finished status check for $SERVICE_DESC services ..." ;; *) echo "Usage: saslev3 start|stop|restart|status" ;; esac
This script assumes everything is on the one machine. If you have the services spread over multiple boxes (more likely) then you could use a controlling script which uses SSH and key based authentication to execute the relevant scripts from a controlling server.
On Solaris you could probably do something a bit more elegant/robust using SMF. There's a document Solaris Service Management Facility - Quickstart Guide which includes SAS as an example. There was also a SUGI30 Paper (225-30) which discussed SAS services with SMF: SAS®9 on Solaris 10: The Doctor is "In" (and Makes House Calls) by Maureen Chew, Sun Microsystems.
I hope this gives you some ideas.
11-20-2012 06:39 AM
we develop SMF services for our applications (like SAS) running on Solaris.
It is easy to manage local dependencies among the SMF services.