[Pkg-samba-maint] r2546 - trunk/ctdb/debian
mparent-guest at alioth.debian.org
mparent-guest at alioth.debian.org
Tue Feb 3 17:41:34 UTC 2009
Author: mparent-guest
Date: 2009-02-03 17:41:34 +0000 (Tue, 03 Feb 2009)
New Revision: 2546
Modified:
trunk/ctdb/debian/changelog
trunk/ctdb/debian/ctdb.init
Log:
Updated init script to better match upstream's one
Modified: trunk/ctdb/debian/changelog
===================================================================
--- trunk/ctdb/debian/changelog 2009-02-03 17:23:40 UTC (rev 2545)
+++ trunk/ctdb/debian/changelog 2009-02-03 17:41:34 UTC (rev 2546)
@@ -8,8 +8,9 @@
* 50_ctdbd_manpage_warning.diff: correct ctdbd(1) manpage warning
* debian/rules: install upstream changelog (taken from specfile)
* debian/copyright: refers to versionned license version
+ * Updated init script to better match upstream's one
- -- Mathieu Parent <math.parent at gmail.com> Tue, 03 Feb 2009 17:07:47 +0100
+ -- Mathieu Parent <math.parent at gmail.com> Tue, 03 Feb 2009 18:37:50 +0100
ctdb (1.0.65-1) experimental; urgency=low
Modified: trunk/ctdb/debian/ctdb.init
===================================================================
--- trunk/ctdb/debian/ctdb.init 2009-02-03 17:23:40 UTC (rev 2545)
+++ trunk/ctdb/debian/ctdb.init 2009-02-03 17:41:34 UTC (rev 2546)
@@ -1,41 +1,32 @@
#!/bin/sh
#
-# based on the ''Example init.d script with LSB support.''
+##############################
+# ctdb: Starts the clustered tdb daemon
#
-# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs at debian.org>
+# chkconfig: - 90 36
#
-# This is free software; you may redistribute it and/or modify
-# it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2,
-# or (at your option) any later version.
+# description: Starts and stops the clustered tdb daemon
+# pidfile: /var/run/ctdbd/ctdbd.pid
#
-# This is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License with
-# the Debian operating system, in /usr/share/common-licenses/GPL; if
-# not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA 02111-1307 USA
-#
+
### BEGIN INIT INFO
-# Provides: ctdb
-# Required-Start: $network $local_fs $remote_fs
-# Required-Stop: $network $local_fs $remote_fs
-# Should-Start:
-# Should-Stop:
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
+# Provides: ctdb
+# Required-Start: $network $local_fs $remote_fs
+# Required-Stop: $network $local_fs $remote_fs
+# Default-Stop:
+# Default-Start: 2 3 4 5
# Short-Description: start and stop ctdb service
# Description: initscript for the ctdb service
### END INIT INFO
+
+set -e
+
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=/usr/sbin/ctdbd # Introduce the server's location here
-NAME=ctdb # Introduce the short server's name here
-DESC="Clustered TDB" # Introduce a short description here
+DAEMON=/usr/sbin/ctdbd
+NAME=ctdb
+DESC="Clustered TDB"
test -x $DAEMON || exit 0
test -x $DAEMON_WRAPPER || exit 0
@@ -100,22 +91,21 @@
CTDB_OPTIONS="$CTDB_OPTIONS --lvs"
}
[ -z "$CTDB_SCRIPT_LOG_LEVEL" ] || {
- CTDB_OPTIONS="$CTDB_OPTIONS --script-log-level=$CTDB_SCRIPT_LOG_LEVEL"
+ CTDB_OPTIONS="$CTDB_OPTIONS --script-log-level=$CTDB_SCRIPT_LOG_LEVEL"
}
-if [ "$CTDB_VALGRIND" = "yes" ]; then
- init_style="valgrind"
-else if [ -x /sbin/startproc ]; then
- init_style="suse"
-else if [ -x /sbin/start-stop-daemon ]; then
- init_style="debian"
- else
- init_style="redhat"
- fi
+detect_init_style
+export CTDB_INIT_STYLE
+
+if [ "x$CTDB_VALGRIND" = "xyes" ]; then
+ init_style="valgrind"
+else
+ init_style="$CTDB_INIT_STYLE"
fi
-fi
-set -e
+set_retval() {
+ return $1
+}
running() {
ps -e | awk '{print $4}' | grep "^ctdbd$" > /dev/null && return 0
@@ -154,7 +144,7 @@
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ctdb || RETVAL=1
;;
- debian)
+ debian|ubuntu)
start-stop-daemon --start --quiet --background --exec /usr/sbin/ctdbd -- $CTDB_OPTIONS
RETVAL=$?
;;
@@ -196,15 +186,17 @@
done
case $init_style in
suse)
+ # re-set the return code to the recorded RETVAL
+ # in order to print the correct status message
+ set_retval $RETVAL
rc_status -v
- ;;
redhat)
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ctdb
echo ""
return $RETVAL
;;
- debian)
+ debian|ubuntu)
return $RETVAL
;;
esac
More information about the Pkg-samba-maint
mailing list