[Pkg-samba-maint] Bug#560385: ctdb: auto init style detection fails with debians init script

Thomas Liske liske at ibh.de
Thu Dec 10 19:35:50 UTC 2009


Package: ctdb
Version: 1.0.99-1~bpo50+1
Severity: minor
Tags: patch

Hi,

allthough the bug is filed against ctdb from bpo, it also applys to the most recent unstable package.
Debian's init.d script expects that the detect_init_style function from /etc/ctdb/functions returns 'ubuntu' in case of a start-stop-daemon aware GNU/Linux environment. detect_init_style returns 'debian' on such environments:


##############################################################
# determine on what type of system (init style) we are running
detect_init_style() {
    # only do detection if not already set:
    test "x$CTDB_INIT_STYLE" != "x" && return

    if [ -x /sbin/startproc ]; then
        CTDB_INIT_STYLE="suse"
    elif [ -x /sbin/start-stop-daemon ]; then
        CTDB_INIT_STYLE="debian"
    else
        CTDB_INIT_STYLE="redhat"
    fi
}


As a workaround one could set CTDB_INIT_STYLE to 'debian' manually in /etc/default/ctdb.

Trival patch:

diff -ur ctdb-1.0.103/debian/ctdb.init ctdb-1.0.103-fix-init-style/debian/ctdb.init
--- ctdb-1.0.103/debian/ctdb.init       2009-12-10 20:10:30.000000000 +0100
+++ ctdb-1.0.103-fix-init-style/debian/ctdb.init        2009-12-10 20:16:29.000000000 +0100
@@ -176,7 +176,7 @@

 check_persistent_databases () {
     case $init_style in
-        ubuntu) PERSISTENT_DB_DIR="${CTDB_DBDIR:-/var/lib/ctdb}/persistent" ;;
+        debian) PERSISTENT_DB_DIR="${CTDB_DBDIR:-/var/lib/ctdb}/persistent" ;;
         *) PERSISTENT_DB_DIR="${CTDB_DBDIR:-/var/ctdb}/persistent" ;;
     esac
     mkdir -p $PERSISTENT_DB_DIR 2>/dev/null
@@ -230,7 +230,7 @@
                echo
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ctdb || RETVAL=1
            ;;
-        ubuntu)
+        debian)
                start-stop-daemon --start --quiet --background \
                    --exec $ctdbd -- $CTDB_OPTIONS
                RETVAL=$?
@@ -248,7 +248,7 @@
     ctdb shutdown >/dev/null 2>&1
     RETVAL=$?
     count=0
-    if [ "$init_style" = "ubuntu" ]; then
+    if [ "$init_style" = "debian" ]; then
         start-stop-daemon --stop --quiet --exec $ctdbd
         RETVAL=$?
     fi


Regards,
Thomas Liske


-- System Information:
Debian Release: 5.0.3
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages ctdb depends on:
ii  iproute              20080725-2          networking and traffic control too
ii  libc6                2.7-18              GNU C Library: Shared libraries
ii  libpopt0             1.14-4              lib for parsing cmdline parameters
ii  lsb-base             3.2-20              Linux Standard Base 3.2 init scrip
ii  psmisc               22.6-1              Utilities that use the proc filesy
ii  tdb-tools            1.1.2~git20080615-1 Trivial Database - bundled binarie
ii  time                 1.7-23              The GNU time program for measuring

Versions of packages ctdb recommends:
ii  ethtool                     6+20080913-1 display or change Ethernet device 

Versions of packages ctdb suggests:
ii  logrotate                  3.7.1-5       Log rotation utility
ii  lsof                       4.78.dfsg.1-4 List open files

-- no debconf information





More information about the Pkg-samba-maint mailing list