Architecting, installing and maintaining your SAS environment

How can I start JBOSS dependant on SAS BI on UNIX?

Reply
Contributor
Posts: 43

How can I start JBOSS dependant on SAS BI on UNIX?

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.

PROC Star
Posts: 392

Re: How can I start JBOSS dependant on SAS BI on UNIX?

Hi Bob,

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.

Cheers

Paul

Contributor
Posts: 27

Re: How can I start JBOSS dependant on SAS BI on UNIX?

Hi Paul,

we develop SMF services for our applications (like SAS) running on Solaris.

It is easy to manage local dependencies among the SMF services.

Regards,

Sándor

Ask a Question
Discussion stats
  • 2 replies
  • 839 views
  • 1 like
  • 3 in conversation