From f89499235c1e3f0748f61674c9cd0b0e17f3005daa402320f71a5a245d30ce3c Mon Sep 17 00:00:00 2001 From: Marcus Rueckert Date: Mon, 17 Jan 2011 17:05:19 +0000 Subject: [PATCH] Accepting request 58451 from Java:packages Accepted submit request 58451 from user mvyskocil OBS-URL: https://build.opensuse.org/request/show/58451 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/hsqldb?expand=0&rev=6 --- hsqldb-1.8.0-standard.cfg | 2 +- hsqldb-1.8.0.10-suse-initscript.patch | 57 ++++++++++++++++----------- hsqldb-1.8.0.8-should-stop.patch | 11 ------ hsqldb.changes | 10 +++++ hsqldb.spec | 2 +- 5 files changed, 45 insertions(+), 37 deletions(-) delete mode 100644 hsqldb-1.8.0.8-should-stop.patch diff --git a/hsqldb-1.8.0-standard.cfg b/hsqldb-1.8.0-standard.cfg index 5001830..89fb86a 100644 --- a/hsqldb-1.8.0-standard.cfg +++ b/hsqldb-1.8.0-standard.cfg @@ -27,7 +27,7 @@ HSQLDB_HOME=/var/lib/hsqldb # Unless you copied a hsqldb.jar file from another system, this typically # resides at $HSQLDB_HOME/lib/hsqldb.jar, where $HSQLDB_HOME is your HSQLDB # software base directory. -HSQLDB_JAR_PATH=${HSQLDB_HOME}/lib/hsqldb.jar +HSQLDB_JAR_PATH=/usr/share/java/hsqldb.jar # Where the file "server.properties" (or "webserver.properties") resides. SERVER_HOME=${HSQLDB_HOME} diff --git a/hsqldb-1.8.0.10-suse-initscript.patch b/hsqldb-1.8.0.10-suse-initscript.patch index c7af41a..e684894 100644 --- a/hsqldb-1.8.0.10-suse-initscript.patch +++ b/hsqldb-1.8.0.10-suse-initscript.patch @@ -1,5 +1,7 @@ ---- bin/hsqldb -+++ bin/hsqldb +Index: bin/hsqldb +=================================================================== +--- bin/hsqldb.orig 2011-01-14 13:55:34.636488672 +0100 ++++ bin/hsqldb 2011-01-14 14:05:37.464628070 +0100 @@ -50,7 +50,7 @@ ### BEGIN INIT INFO # Provides: HSQLDB-Server @@ -9,7 +11,7 @@ # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: HSQLDB-Server -@@ -89,19 +89,69 @@ +@@ -89,19 +89,73 @@ # -- blaine.simpson@admc.com @@ -44,7 +46,11 @@ + set +u -+NAME="$(basename $0)" ++# "chown" lives in /usr on some UNIXes. ++PATH="/bin:/sbin:/usr/sbin" ++ ++ ++NAME="$(/bin/basename $0)" +unset ISBOOT +if [ "${NAME:0:1}" = "S" -o "${NAME:0:1}" = "K" ]; then + NAME="${NAME:3}" @@ -67,7 +73,8 @@ # Will not necessarily be set correctly at system bootup invocations # (where it is sometimes invoked like "sh... /path/to/hsqldb start"), # but, in those cases there will be no recursion. - INVOC_PATH=`dirname "$0"` || { +-INVOC_PATH=`dirname "$0"` || { ++INVOC_PATH=`/usr/bin/dirname "$0"` || { echo "'dirname' failed" 1>&2 - exit 2 + rc_failed 1 @@ -81,9 +88,12 @@ # You can override any of these default values in your config file: -@@ -112,7 +162,10 @@ +@@ -110,9 +164,12 @@ + SU_ECHO_SECS=1 + # File used as semaphore. If file is removed, a running pid checker # process will exit. - PIDCHECKER_FLAGFILE=`mktemp /tmp/hsqldb.XXXXXXXX` +-PIDCHECKER_FLAGFILE=`mktemp /tmp/hsqldb.XXXXXXXX` ++PIDCHECKER_FLAGFILE=`/bin/mktemp /tmp/hsqldb.XXXXXXXX` if [ x"$PIDCHECKER_FLAGFILE" = "x" ] ; then - echo "unable to create tmp file"; exit 1 + echo "unable to create tmp file" @@ -93,7 +103,7 @@ fi # The following settings get overridden by optional setting in the config file. # Time to allow for JVM to die after all HSQLDB instances stopped. -@@ -168,25 +221,31 @@ +@@ -168,25 +225,31 @@ done [ -n "$CFGFILE" ] || { echo "No global config file found in any of allowed locations" 1>&2 @@ -129,7 +139,7 @@ } # Use bsd-style enable/disable if it's in place. -@@ -209,11 +268,15 @@ +@@ -209,11 +272,15 @@ [ -r "$CFGFILE" ] || { echo "Unable to read config file '$CFGFILE'" 1>&2 @@ -147,7 +157,7 @@ } HSQLDB_OWNER= JAVA_EXECUTABLE= -@@ -221,6 +284,28 @@ +@@ -221,6 +288,28 @@ SERVER_HOME= SHUTDOWN_URLIDS= . "$CFGFILE" @@ -176,7 +186,7 @@ # Suffix delimiter to $SERVER_ADDL_CLASSPATH, if it is set. [ -n "$SERVER_ADDL_CLASSPATH" ] && SERVER_ADDL_CLASSPATH="${SERVER_ADDL_CLASSPATH}:" -@@ -229,15 +314,21 @@ +@@ -229,15 +318,21 @@ [ -n "$SERVER_HOME" ] || { echo "Config file '$CFGFILE' does not set one or more of following variables JAVA_EXECUTABLE, HSQLDB_JAR_PATH, SERVER_HOME" 1>&2 @@ -201,7 +211,7 @@ } # PROPERTY_FILE is a derived value. -@@ -246,27 +337,38 @@ +@@ -246,28 +341,36 @@ WebServer) PROPERTY_FILE="$SERVER_HOME"/webserver.properties;; *) echo 'Unsupported value for $TARGET_CLASS: '"$TARGET_CLASS" 1>&2 @@ -242,12 +252,11 @@ -# "chown" lives here on some UNIXes. -PATH="$PATH:/usr/sbin" -+# "chown" lives in /usr on some UNIXes. -+PATH="/bin:/sbin:/usr/sbin" - +- # Make a good effort (but not bullet-proof) check on permissions of the # auth file. Unfortunately, if auth-file is not specified, this depends -@@ -279,15 +381,21 @@ + # upon both (a) $HOME being set; and (b) SqlToolSprayer and SqlTool defaults. +@@ -279,15 +382,21 @@ [ -n "${_AUTH_TEST_PATH}" ] || _AUTH_TEST_PATH="$HOME/sqltool.rc" [ -f "$_AUTH_TEST_PATH" ] || { echo "No auth file found at '$_AUTH_TEST_PATH'" 1>&2 @@ -272,7 +281,7 @@ } fi -@@ -296,29 +404,37 @@ +@@ -296,29 +405,37 @@ [ -r "$PIDFILE" ] && { [ -f "$PIDFILE" ] || { echo "'$PIDFILE' is not a regular file" 1>&2 @@ -317,7 +326,7 @@ } HSQLDB_PID= } -@@ -329,7 +445,9 @@ +@@ -329,7 +446,9 @@ status) [ -n "$HSQLDB_PID" ] || { echo "I don't know of any running hsqldb server." @@ -328,7 +337,7 @@ } echo "There is an hsqldb server loaded from $HSQLDB_JAR_PATH running with pid $HSQLDB_PID." -@@ -348,32 +466,42 @@ +@@ -348,32 +467,42 @@ "-Dsqltoolsprayer.propfile=$PROPERTY_FILE" \ "-Dsqltoolsprayer.monfile=$PIDFILE" \ org.hsqldb.util.SqlToolSprayer '--;' @@ -377,7 +386,7 @@ } export JAVA_EXECUTABLE export HSQLDB_JAR_PATH -@@ -382,10 +510,12 @@ +@@ -382,10 +511,12 @@ export SERVER_JVMARGS export TARGET_CLASS export INVOC_ADDL_ARGS @@ -392,7 +401,7 @@ } eval exec "$JAVA_EXECUTABLE" $SERVER_JVMARGS $TLS_SWITCHES -classpath "${SERVER_ADDL_CLASSPATH}${HSQLDB_JAR_PATH}" org.hsqldb.util.MainInvoker org.hsqldb.$TARGET_CLASS $INVOC_ADDL_ARGS ' >> "$LOGFILE" 2>&1 & -@@ -404,7 +534,9 @@ +@@ -404,7 +535,9 @@ # but regardless of why, the pid file does not contain a valid pid. touch "$PIDCHECKER_FLAGFILE" || { echo "Failed to touch file '$PIDCHECKER_FLAGFILE'" 1>&2 @@ -403,7 +412,7 @@ } export PIDCHECKER_FLAGFILE export PIDFILE -@@ -414,7 +546,9 @@ +@@ -414,7 +547,9 @@ [ -f "$PIDCHECKER_FLAGFILE" ] || exit 0 kill -0 "`cat $PIDFILE`" > /dev/null 2>&1 || { rm -f "$PIDFILE" "$PIDCHECKER_FLAGFILE" @@ -414,7 +423,7 @@ } sleep 1 done -@@ -426,18 +560,24 @@ +@@ -426,18 +561,24 @@ org.hsqldb.util.SqlToolSprayer '--;' && { rm -f "$PIDCHECKER_FLAGFILE" echo "org.hsqldb.$TARGET_CLASS started with pid `cat $PIDFILE`" @@ -442,7 +451,7 @@ } AUTH_FILE_SWITCH= # N.b., there will be a problem if there are special characters or -@@ -455,23 +595,64 @@ +@@ -455,23 +596,64 @@ sleep $MAX_TERMINATE_SECS # Give the JVM a sec. or 2 to fully exit. kill -0 "$HSQLDB_PID" > /dev/null 2>&1 && { echo "WARNING: hsqldb is still running!" 1>&2 diff --git a/hsqldb-1.8.0.8-should-stop.patch b/hsqldb-1.8.0.8-should-stop.patch deleted file mode 100644 index 1207ce9..0000000 --- a/hsqldb-1.8.0.8-should-stop.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- bin/hsqldb -+++ bin/hsqldb -@@ -50,7 +50,7 @@ - ### BEGIN INIT INFO - # Provides: HSQLDB-Server - # Required-Start: $syslog $remote_fs $network $named --# Required-Stop: -+# Required-Stop: $syslog $remote_fs $network $named - # Default-Start: 3 5 - # Default-Stop: 0 1 2 6 - # Short-Description: HSQLDB-Server diff --git a/hsqldb.changes b/hsqldb.changes index 58a7b0e..8e0b68b 100644 --- a/hsqldb.changes +++ b/hsqldb.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Fri Jan 14 14:11:21 UTC 2011 - mvyskocil@suse.cz + +- fix bnc#664425 - error in init script of hsqldb + * init PATH on the begining + * use absolute names +- change default shell from /bin/false to /bin/sh to make su command + (and server start) possible +- change hsqldb jar location to /usr/share/java/hsqldb.jar + ------------------------------------------------------------------- Wed May 13 09:11:43 CEST 2009 - mvyskocil@suse.cz diff --git a/hsqldb.spec b/hsqldb.spec index 43971a9..1818736 100644 --- a/hsqldb.spec +++ b/hsqldb.spec @@ -245,7 +245,7 @@ fi if [ `getent passwd %{name}` ]; then : OK user hsqldb already present else - %{_sbindir}/useradd -r -g %{name} -c "Hsqldb" -s /bin/false \ + %{_sbindir}/useradd -r -g %{name} -c "Hsqldb" -s /bin/sh \ -d %{_localstatedir}/lib/%{name} -o %{name} 2> /dev/null || : fi