packages: glassfish/glassfish-javadb.init (NEW) - initial, based on glassfi...

pawelz pawelz at pld-linux.org
Thu Jan 7 14:44:55 CET 2010


Author: pawelz                       Date: Thu Jan  7 13:44:55 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- initial, based on glassfish.init

---- Files affected:
packages/glassfish:
   glassfish-javadb.init (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/glassfish/glassfish-javadb.init
diff -u /dev/null packages/glassfish/glassfish-javadb.init:1.1
--- /dev/null	Thu Jan  7 14:44:56 2010
+++ packages/glassfish/glassfish-javadb.init	Thu Jan  7 14:44:50 2010
@@ -0,0 +1,93 @@
+#!/bin/sh
+#
+# glassfish	Apache Derby database
+#
+# chkconfig:	345 84 16
+#
+# description:	Apache Derby database
+#
+# processname:	glassfish-javadb
+# config:
+# pidfile:
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/glassfish ] && . /etc/sysconfig/glassfish
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+	if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+		msg_network_down "glassfish-javadb"
+		exit 1
+	fi
+else
+	exit 0
+fi
+
+start() {
+	# Check if the service is already running?
+	if [ -f /var/lock/subsys/glassfish-javadb ]; then
+		msg_already_running "glassfish-javadb"
+		return
+	fi
+
+	msg_starting "glassfish-javadb"
+	daemon glassfish start-database
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/glassfish-javadb
+}
+
+stop() {
+	if [ ! -f /var/lock/subsys/glassfish-javadb ]; then
+		msg_not_running "glassfish-javadb"
+		return
+	fi
+
+	msg_stopping "glassfish-javadb"
+	daemon glassfish stop-database
+	rm -f /var/lock/subsys/glassfish-javadb
+}
+
+condrestart() {
+	if [ ! -f /var/lock/subsys/glassfish-javadb ]; then
+		msg_not_running "glassfish-javadb"
+		RETVAL=$1
+		return
+	fi
+
+	stop
+	start
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
+	;;
+  restart)
+	stop
+	start
+	;;
+  try-restart)
+	condrestart 0
+	;;
+  force-reload)
+	condrestart 7
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+	exit 3
+esac
+
+exit $RETVAL
================================================================


More information about the pld-cvs-commit mailing list