diff -Nru dlm-4.0.1/debian/changelog dlm-4.0.1/debian/changelog --- dlm-4.0.1/debian/changelog 2013-07-25 14:07:59.000000000 -0700 +++ dlm-4.0.1/debian/changelog 2016-01-27 10:41:56.000000000 -0700 @@ -1,3 +1,15 @@ +dlm (4.0.1-0ubuntu1.14.04.1) trusty; urgency=medium + + * Debianize init script to fix broken package install (Closes: #1248054) + - debian/patches/debianize_init_script.patch: source + /lib/lsb/init-functions instead of /etc/rc.d/init.d/init-functions, + use start-stop-daemon and remove rh_* specific function targets. + - debian/local/modules-load.conf: create new file to define the kernel + modules which need to be loaded at system start. + - debian/rules: install the modules config file + + -- Billy Olsen Wed, 13 Jan 2016 18:02:24 -0700 + dlm (4.0.1-0ubuntu1) saucy; urgency=low * Initial release: diff -Nru dlm-4.0.1/debian/local/modules-load.conf dlm-4.0.1/debian/local/modules-load.conf --- dlm-4.0.1/debian/local/modules-load.conf 1969-12-31 17:00:00.000000000 -0700 +++ dlm-4.0.1/debian/local/modules-load.conf 2016-01-13 18:01:12.000000000 -0700 @@ -0,0 +1,3 @@ +# Modules necessary to ensure that the dlm daemon is able to run +configfs +dlm diff -Nru dlm-4.0.1/debian/patches/debianize_init_script.patch dlm-4.0.1/debian/patches/debianize_init_script.patch --- dlm-4.0.1/debian/patches/debianize_init_script.patch 1969-12-31 17:00:00.000000000 -0700 +++ dlm-4.0.1/debian/patches/debianize_init_script.patch 2016-01-13 18:00:40.000000000 -0700 @@ -0,0 +1,173 @@ +--- dlm-4.0.1_orig/init/dlm.init 2015-12-01 15:43:12.883110192 -0700 ++++ dlm-4.0.1/init/dlm.init 2015-12-01 15:43:02.014836292 -0700 +@@ -19,48 +19,51 @@ + # Description: starts and stops dlm_controld + ### END INIT INFO + +-. /etc/rc.d/init.d/functions ++DESC="dlm control daemon" ++NAME="dlm_controld" ++DAEMON_OPTS="" + +-prog="dlm_controld" + progdir="cluster" +-lockfile="/var/run/$progdir/$prog.pid" +-exec="/usr/sbin/$prog" ++lockfile="/var/run/$progdir/$NAME.pid" ++exec="/usr/sbin/$NAME" ++ ++[ -x $exec ] || exit 0 ++ ++. /lib/init/vars.sh ++. /lib/lsb/init-functions + + [ -f /etc/sysconfig/dlm ] && . /etc/sysconfig/dlm + + setup() { + modprobe dlm > /dev/null 2>&1 +- mount -t configfs none /sys/kernel/config > /dev/null 2>&1 ++ if [ ! -d /sys/kernel/config ]; then ++ mount -t configfs none /sys/kernel/config > /dev/null 2>&1 ++ fi + } + +-start() { ++do_start() { + breakpoint="$1" + + [ -x $exec ] || exit 5 + + if [ ! -d /var/run/$progdir ]; then + mkdir -p /var/run/$progdir +- [ -x /usr/sbin/restorecon ] && restorecon /var/run/$progdir + fi + + setup + + [ "$breakpoint" = "setup" ] && exit 0 + +- echo -n $"Starting $prog: " +- daemon $prog $DLM_CONTROLD_OPTS +- retval=$? +- echo +- [ $retval -eq 0 ] +- return $retval ++ start-stop-daemon --start --quiet --exec $exec -- $DAEMON_OPTS || status="$?" ++ status=$? ++ [ $status -eq 0 ] ++ return $status + } + +-stop() { +- echo -n $"Stopping $prog: " +- killproc -p $lockfile $prog -TERM +- retval=$? +- echo +- [ $retval -eq 0 ] ++do_stop() { ++ start-stop-daemon --stop --quiet --name dlm_controld ++ status=$? ++ return $status + } + + wait_for_stop() { +@@ -69,50 +72,60 @@ + done + } + +-restart() { +- stop +- wait_for_stop +- start +-} +- +-reload() { +- restart +-} +- +-rh_status() { +- status $prog +-} +- +-rh_status_q() { +- rh_status >/dev/null 2>&1 +-} +- + case "$1" in + start) +- rh_status_q && exit 0 +- $1 "$2" +- ;; ++ # start the dlm control daemon ++ log_daemon_msg "Starting $DESC" "$NAME" ++ do_start $2 ++ status=$? ++ case "$status" in ++ 0) log_end_msg 0 ;; ++ 1) log_action_msg " already running" ; log_end_msg 0 ;; ++ *) log_end_msg 1 ;; ++ esac ++ exit $status ++ ;; + stop) +- rh_status_q || exit 0 +- $1 +- ;; +- restart) +- $1 +- ;; ++ # stop the dlm control daemon ++ log_daemon_msg "Stopping $DESC" "$NAME" ++ do_stop ++ status=$? ++ case "$status" in ++ 0) log_end_msg 0 ;; ++ 1) log_action_msg " already stopped" ; log_end_msg 0 ;; ++ *) log_end_msg 1 ;; ++ esac ++ exit $status ++ ;; ++ restart|force-reload) ++ $0 stop ++ wait_for_stop ++ $0 start ++ ;; + reload) +- rh_status_q || exit 7 +- $1 +- ;; +- force-reload) +- force_reload +- ;; +- status) +- rh_status +- ;; ++ $0 status ++ status=$? ++ if [ ! $status -eq 0 ]; then ++ exit 7 ++ fi ++ $0 restart ++ ;; + condrestart|try-restart) +- rh_status_q || exit 0 +- restart +- ;; ++ $0 status ++ status=$? ++ [ $status -eq 0 ] || exit 0 ++ $0 restart ++ ;; ++ status) ++ pid=$( pidof $exec ) ++ if [ -n "$pid" ]; then ++ log_action_msg "$DESC is running" ++ else ++ log_action_msg "$DESC is not running" ++ exit 3 ++ fi ++ exit 0 ++ ;; + *) + echo $"Usage $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" + exit 2 diff -Nru dlm-4.0.1/debian/patches/series dlm-4.0.1/debian/patches/series --- dlm-4.0.1/debian/patches/series 2013-07-24 10:26:16.000000000 -0700 +++ dlm-4.0.1/debian/patches/series 2016-01-13 18:00:40.000000000 -0700 @@ -1,3 +1,4 @@ fix_lib_dir.patch fix_manpages.patch fix_init_script.patch +debianize_init_script.patch diff -Nru dlm-4.0.1/debian/rules dlm-4.0.1/debian/rules --- dlm-4.0.1/debian/rules 2013-07-24 09:48:10.000000000 -0700 +++ dlm-4.0.1/debian/rules 2016-01-13 18:02:05.000000000 -0700 @@ -21,3 +21,7 @@ cp init/dlm.init $(BUILDROOT)/debian/dlm.init dh_install --sourcedir=debian/tmp --list-missing + + # install the modules loader to ensure that the dlm modules are loaded + # at system startup. + install -D -m 644 debian/local/modules-load.conf debian/dlm/etc/modules-load.d/dlm.conf