Index: debian_installer/lams2/debian/lams2.init =================================================================== diff -u -re76fd205caafcee0c7521337f99071b574a1bfe3 -r501a6ab11cb7e716cb88e44a420bedd52e4f92b8 --- debian_installer/lams2/debian/lams2.init (.../lams2.init) (revision e76fd205caafcee0c7521337f99071b574a1bfe3) +++ debian_installer/lams2/debian/lams2.init (.../lams2.init) (revision 501a6ab11cb7e716cb88e44a420bedd52e4f92b8) @@ -1,12 +1,17 @@ #!/bin/sh # -# Written by Miquel van Smoorenburg . -# Modified for Debian -# by Ian Murdock . -# -# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl -# +### BEGIN INIT INFO +# Provides: lams2 +# Required-Start: $remote_fs $mysql +# Required-Stop: $remote_fs $mysql +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start and stop the lams2 jboss server +# Description: Starts and stops the JBoss server where lams2 is installed. +### END INIT INFO +. /lib/lsb/init-functions + # Attempt to locate JAVA_HOME, code borrowed from jabref package if [ -z $JAVA_HOME ] then @@ -23,6 +28,8 @@ USER=lams GROUP=lams JBOSS_OPTS= +# Use this when using a non-default server configuration in jboss +#JBOSS_OPTS="-c " test -x $JAVA || exit 0 @@ -55,14 +62,11 @@ JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JBOSS_BOOT_CLASSPATH:$JAVAC_JAR" fi - DAEMON_OPTS="$JAVA_OPTS \ -Djava.endorsed.dirs=$JBOSS_ENDORSED_DIRS \ -classpath $JBOSS_CLASSPATH \ org.jboss.Main $JBOSS_OPTS" - -#set -e start() { start-stop-daemon --start --quiet --background --make-pidfile \ --pidfile $PIDFILE --chuid $USER:$GROUP \ @@ -75,14 +79,15 @@ case "$1" in start) - echo "$LONGNAME is starting up." + log_daemon_msg "Starting $LONGNAME" "$NAME" start + log_end_msg 0 ;; stop) - echo -n "Stopping $LONGNAME... " + log_daemon_msg "Stopping $LONGNAME" "$NAME" stop rm -f "$PIDFILE" - echo "stopped." + log_end_msg 0 ;; status) if [ -e $PIDFILE ]; then @@ -92,35 +97,36 @@ if [ "X$pidtest" = "X" ] then rm -f "$PIDFILE" - echo "Removed stale pid file: $PIDFILE" + log_action_msg "Removed stale pid file: $PIDFILE" pid="" fi if [ "X$pid" = "X" ]; then - echo "$LONGNAME is not running." - exit 1 + log_action_msg "$LONGNAME is not running." + exit 0 else - echo "$LONGNAME is running ($pid)." + log_action_msg "$LONGNAME is running ($pid)." exit 0 fi else - echo "Cannot read $PIDFILE." + log_failure_msg "Cannot read $PIDFILE." exit 1 fi fi - echo "$LONGNAME is not running." + log_action_msg "$LONGNAME is not running." ;; restart|force-reload) # # If the "reload" option is implemented, move the "force-reload" # option to the "reload" entry above. If not, "force-reload" is # just the same as "restart". # - echo -n "Restarting $LONGNAME: " + log_daemon_msg "Restarting $LONGNAME" "$NAME" #set +e stop #set -e sleep 10 - start + start + log_end_msg 0 ;; *) SELF=`dirname $0`/`basename $0`