Skip to content

Commit

Permalink
Merge pull request #72 from pbugni/master
Browse files Browse the repository at this point in the history
system properties and startup scripts
  • Loading branch information
Pcb committed Apr 25, 2012
2 parents d6831b0 + 0ce3890 commit 3086510
Show file tree
Hide file tree
Showing 7 changed files with 435 additions and 3 deletions.
69 changes: 69 additions & 0 deletions cds/etc/init.d/cds
@@ -0,0 +1,69 @@
#! /bin/sh
#
# /etc/init.d/cds -- startup script for OpenEMRConnect Central Document Store
#
### BEGIN INIT INFO
# Provides: cds
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Should-Start: $named
# Should-Stop: $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start CDS
# Description: Start the OpenEMRConnect Central Document Store
### END INIT INFO


NAME=cds

CONFIGDIR="/etc/OpenEMRConnect/$NAME/"
PIDFILE="/var/run/$NAME.pid"
RUNTIMEDIR="/var/run/$NAME/"
LOGDIR="/var/log/$NAME"
LOGFILE="$LOGDIR/$NAME.log"
UBERJAR="/opt/OpenEMRConnect/$NAME/$NAME-1.0-SNAPSHOT-jar-with-dependencies.jar"
USER=oecuser
DAEMON="/usr/bin/java"
DAEMON_ARGS="-DconfigDirectory=$CONFIGDIR -DruntimeDirectory=$RUNTIMEDIR -jar $UBERJAR"

if [ ! -d $RUNTIMEDIR ]; then
mkdir $RUNTIMEDIR;
chown $USER $RUNTIMEDIR;
fi

if [ ! -d $LOGDIR ]; then
mkdir $LOGDIR;
chown $USER $LOGDIR;
fi

case "$1" in
start)
echo -n "Starting daemon: "$NAME
start-stop-daemon --start --pidfile "$PIDFILE" --chuid $USER --verbose --make-pidfile --exec "$DAEMON" -- $DAEMON_ARGS >>$LOGFILE 2>&1 &
echo "."
;;

stop)
echo -n "Stopping daemon: "$NAME
start-stop-daemon --stop --pidfile "$PIDFILE" --retry=TERM/30/KILL/5
echo "."
;;

status)
if kill -0 `cat $PIDFILE` > /dev/null 2>&1; then
echo "Running"
exit 0
else
echo "Not running"
exit 1
fi
;;

*)
echo "Usage: "$1" {start|stop|status}"
exit 1

esac

exit 0
69 changes: 69 additions & 0 deletions esb/etc/init.d/esb
@@ -0,0 +1,69 @@
#! /bin/sh
#
# /etc/init.d/esb -- startup script for OpenEMRConnect Enterprise Service Bus
#
### BEGIN INIT INFO
# Provides: esb
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Should-Start: $named
# Should-Stop: $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start ESB
# Description: Start the OpenEMRConnect Enterprise Service Bus
### END INIT INFO


NAME=esb

CONFIGDIR="/etc/OpenEMRConnect/$NAME/"
PIDFILE="/var/run/$NAME.pid"
RUNTIMEDIR="/var/run/$NAME/"
LOGDIR="/var/log/$NAME"
LOGFILE="$LOGDIR/$NAME.log"
UBERJAR="/opt/OpenEMRConnect/$NAME/$NAME-1.0-SNAPSHOT-jar-with-dependencies.jar"
USER=oecuser
DAEMON="/usr/bin/java"
DAEMON_ARGS="-DconfigDirectory=$CONFIGDIR -DruntimeDirectory=$RUNTIMEDIR -jar $UBERJAR"

if [ ! -d $RUNTIMEDIR ]; then
mkdir $RUNTIMEDIR;
chown $USER $RUNTIMEDIR;
fi

if [ ! -d $LOGDIR ]; then
mkdir $LOGDIR;
chown $USER $LOGDIR;
fi

case "$1" in
start)
echo -n "Starting daemon: "$NAME
start-stop-daemon --start --pidfile "$PIDFILE" --chuid $USER --verbose --make-pidfile --exec "$DAEMON" -- $DAEMON_ARGS >>$LOGFILE 2>&1 &
echo "."
;;

stop)
echo -n "Stopping daemon: "$NAME
start-stop-daemon --stop --pidfile "$PIDFILE" --retry=TERM/30/KILL/5
echo "."
;;

status)
if kill -0 `cat $PIDFILE` > /dev/null 2>&1; then
echo "$NAME Running"
exit 0
else
echo "$NAME Not running"
exit 1
fi
;;

*)
echo "Usage: "$1" {start|stop|status}"
exit 1

esac

exit 0
70 changes: 70 additions & 0 deletions esb/etc/init.d/fsb
@@ -0,0 +1,70 @@
#! /bin/sh
#
# /etc/init.d/fsb -- startup script for OpenEMRConnect Facilities Service Bus
#
### BEGIN INIT INFO
# Provides: fsb
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Should-Start: $named
# Should-Stop: $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start FSB
# Description: Start the OpenEMRConnect Facilities Service Bus
### END INIT INFO


NAME=fsb
PACKAGE=esb

CONFIGDIR="/etc/OpenEMRConnect/$NAME/"
PIDFILE="/var/run/$NAME.pid"
RUNTIMEDIR="/var/run/$NAME/"
LOGDIR="/var/log/$NAME"
LOGFILE="$LOGDIR/$NAME.log"
UBERJAR="/opt/OpenEMRConnect/$NAME/$PACKAGE-1.0-SNAPSHOT-jar-with-dependencies.jar"
USER=oecuser
DAEMON="/usr/bin/java"
DAEMON_ARGS="-DconfigDirectory=$CONFIGDIR -DruntimeDirectory=$RUNTIMEDIR -jar $UBERJAR"

if [ ! -d $RUNTIMEDIR ]; then
mkdir $RUNTIMEDIR;
chown $USER $RUNTIMEDIR;
fi

if [ ! -d $LOGDIR ]; then
mkdir $LOGDIR;
chown $USER $LOGDIR;
fi

case "$1" in
start)
echo -n "Starting daemon: "$NAME
start-stop-daemon --start --pidfile "$PIDFILE" --chuid $USER --verbose --make-pidfile --exec "$DAEMON" -- $DAEMON_ARGS >>$LOGFILE 2>&1 &
echo "."
;;

stop)
echo -n "Stopping daemon: "$NAME
start-stop-daemon --stop --pidfile "$PIDFILE" --retry=TERM/30/KILL/5
echo "."
;;

status)
if kill -0 `cat $PIDFILE` > /dev/null 2>&1; then
echo "$NAME Running"
exit 0
else
echo "$NAME Not running"
exit 1
fi
;;

*)
echo "Usage: "$1" {start|stop|status}"
exit 1

esac

exit 0
69 changes: 69 additions & 0 deletions loggingserver/etc/init.d/loggingserver
@@ -0,0 +1,69 @@
#! /bin/sh
#
# /etc/init.d/loggingserver -- startup script for OpenEMRConnect Logging Server
#
### BEGIN INIT INFO
# Provides: loggingserver
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Should-Start: $named
# Should-Stop: $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start LOGGINGSERVER
# Description: Start the OpenEMRConnect Logging Server
### END INIT INFO


NAME=loggingserver

CONFIGDIR="/etc/OpenEMRConnect/$NAME/"
PIDFILE="/var/run/$NAME.pid"
RUNTIMEDIR="/var/run/$NAME/"
LOGDIR="/var/log/$NAME"
LOGFILE="$LOGDIR/$NAME.log"
UBERJAR="/opt/OpenEMRConnect/$NAME/$NAME-1.0-SNAPSHOT-jar-with-dependencies.jar"
USER=oecuser
DAEMON="/usr/bin/java"
DAEMON_ARGS="-DconfigDirectory=$CONFIGDIR -DruntimeDirectory=$RUNTIMEDIR -jar $UBERJAR"

if [ ! -d $RUNTIMEDIR ]; then
mkdir $RUNTIMEDIR;
chown $USER $RUNTIMEDIR;
fi

if [ ! -d $LOGDIR ]; then
mkdir $LOGDIR;
chown $USER $LOGDIR;
fi

case "$1" in
start)
echo -n "Starting daemon: "$NAME
start-stop-daemon --start --pidfile "$PIDFILE" --chuid $USER --verbose --make-pidfile --exec "$DAEMON" -- $DAEMON_ARGS >>$LOGFILE 2>&1 &
echo "."
;;

stop)
echo -n "Stopping daemon: "$NAME
start-stop-daemon --stop --pidfile "$PIDFILE" --retry=TERM/30/KILL/5
echo "."
;;

status)
if kill -0 `cat $PIDFILE` > /dev/null 2>&1; then
echo "Running"
exit 0
else
echo "Not running"
exit 1
fi
;;

*)
echo "Usage: "$1" {start|stop|status}"
exit 1

esac

exit 0
70 changes: 70 additions & 0 deletions mpi/etc/init.d/lpi
@@ -0,0 +1,70 @@
#! /bin/sh
#
# /etc/init.d/lpi -- startup script for OpenEMRConnect Local Patient Index
#
### BEGIN INIT INFO
# Provides: lpi
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Should-Start: $named
# Should-Stop: $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start LPI
# Description: Start the OpenEMRConnect Local Patient Index
### END INIT INFO


NAME=lpi
PACKAGE=mpi

CONFIGDIR="/etc/OpenEMRConnect/$NAME/"
PIDFILE="/var/run/$NAME.pid"
RUNTIMEDIR="/var/run/$NAME/"
LOGDIR="/var/log/$NAME"
LOGFILE="$LOGDIR/$NAME.log"
UBERJAR="/opt/OpenEMRConnect/$NAME/$PACKAGE-1.0-SNAPSHOT-jar-with-dependencies.jar"
USER=oecuser
DAEMON="/usr/bin/java"
DAEMON_ARGS="-DconfigDirectory=$CONFIGDIR -DruntimeDirectory=$RUNTIMEDIR -jar $UBERJAR"

if [ ! -d $RUNTIMEDIR ]; then
mkdir $RUNTIMEDIR;
chown $USER $RUNTIMEDIR;
fi

if [ ! -d $LOGDIR ]; then
mkdir $LOGDIR;
chown $USER $LOGDIR;
fi

case "$1" in
start)
echo -n "Starting daemon: "$NAME
start-stop-daemon --start --pidfile "$PIDFILE" --chuid $USER --verbose --make-pidfile --exec "$DAEMON" -- $DAEMON_ARGS >>$LOGFILE 2>&1 &
echo "."
;;

stop)
echo -n "Stopping daemon: "$NAME
start-stop-daemon --stop --pidfile "$PIDFILE" --retry=TERM/30/KILL/5
echo "."
;;

status)
if kill -0 `cat $PIDFILE` > /dev/null 2>&1; then
echo "$NAME Running"
exit 0
else
echo "$NAME Not running"
exit 1
fi
;;

*)
echo "Usage: "$1" {start|stop|status}"
exit 1

esac

exit 0

0 comments on commit 3086510

Please sign in to comment.