Welcome Guest! Log in
Stambia versions 2.x, 3.x, S17, S18, S19 and S20 are reaching End of Support January, 15th, 2024. Please consider upgrading to the supported Semarchy xDI versions. See Global Policy Support and the Semarchy Documentation.

The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…


Here is a sample init.d script for executing the Runtime as a Linux service.

This sample script should be adapted to your specific Linux distribution, server architecture and enterprise best practices.
Please consult your Linux distribution's docs to know how to install and register a service.

Sample script

This sample script executes the Runtime as the "stambia" user. Please adapt it to your particular needs (directory, runtime port, user...).

We have created this script in file /etc/init.d/stambiaRuntime

And then we registered the service for startup with this command: sudo update-rc.d stambiaRuntime defaults

#!/bin/sh

# runtime install dir
export dir=/data/stambiaRuntimeSupport

# runtime port - necessary for stopping the runtime
export port=42000

start()
{
  su - stambia -c "cd $dir;nohup ./startengine.sh &"
}

stop()
{
  su - stambia -c "cd $dir;./stopengine.sh -port $port"
}

restart()
{
    stop;
    sleep 1;
    start;
}

case $1 in
start)
  start;;
stop)
  stop;;
restart)
  restart;;
*)
  start;;
esac

Starting / Stopping the service

Simply replace "stambiaRuntime" with your init.d script name:

$ sudo service stambiaRuntime start
$ sudo service stambiaRuntime stop
$ sudo service stambiaRuntime restart

 

 

 

Articles

Suggest a new Article!