[Pkg-cyrus-sasl2-commits] r53 - in /cyrus-sasl-2.1/trunk/debian:
sasl2-bin.saslauthd.init
sasl2-bin.saslauthd.prerm sasl2-bin.saslauthd.prostinst
el_cubano-guest at users.alioth.debian.org
el_cubano-guest at users.alioth.debian.org
Fri Oct 20 06:57:07 UTC 2006
Author: el_cubano-guest
Date: Sun Oct 15 19:33:40 2006
New Revision: 53
URL: http://svn.debian.org/wsvn/pkg-cyrus-sasl2/?sc=1&rev=53
Log:
Modifications to prerm/postinst and the init script so that package install/remove/purge does not fail
Added:
cyrus-sasl-2.1/trunk/debian/sasl2-bin.saslauthd.prerm
cyrus-sasl-2.1/trunk/debian/sasl2-bin.saslauthd.prostinst
Modified:
cyrus-sasl-2.1/trunk/debian/sasl2-bin.saslauthd.init
Modified: cyrus-sasl-2.1/trunk/debian/sasl2-bin.saslauthd.init
URL: http://svn.debian.org/wsvn/pkg-cyrus-sasl2/cyrus-sasl-2.1/trunk/debian/sasl2-bin.saslauthd.init?rev=53&op=diff
==============================================================================
--- cyrus-sasl-2.1/trunk/debian/sasl2-bin.saslauthd.init (original)
+++ cyrus-sasl-2.1/trunk/debian/sasl2-bin.saslauthd.init Sun Oct 15 19:33:40 2006
@@ -25,9 +25,20 @@
RUN_DIR=/var/run/$NAME
PIDFILE=$RUN_DIR/saslauthd.pid
SCRIPTNAME=/etc/init.d/$NAME
+if [ "$MAINTSCRIPT" == "yes" ]; then
+ # We are being called by postinst or prerm script and need to modify
+ # our exit codes so that package install or removal does not fail for
+ # no reason
+ EXIT_ERROR_CODE=0
+else
+ # We are being called by the admin or something other than a package
+ # maintainer script and are expected to actually pass a non-zero
+ # exit code
+ EXIT_ERROR_CODE=1
+fi
# Exit if the package is not installed
-[ -x "$DAEMON" ] || exit 0
+[ -x "$DAEMON" ] || exit $EXIT_ERROR_CODE
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
@@ -42,14 +53,14 @@
# If the daemon is not enabled, give the user a useful error and then exit
if [ "$START" != "yes" ]; then
log_failure_msg "To enable $NAME, edit /etc/default/$NAME and add START=yes"
- exit 1
+ exit $EXIT_ERROR_CODE
fi
# If no mechanisms are defined, log this and exit
if [ -z $MECHANISMS ]; then
log_failure_msg "No mechanisms defined in /etc/default/$NAME," \
"not starting $NAME."
- exit 1
+ exit $EXIT_ERROR_CODE
fi
# Construct argument string
Added: cyrus-sasl-2.1/trunk/debian/sasl2-bin.saslauthd.prerm
URL: http://svn.debian.org/wsvn/pkg-cyrus-sasl2/cyrus-sasl-2.1/trunk/debian/sasl2-bin.saslauthd.prerm?rev=53&op=file
==============================================================================
--- cyrus-sasl-2.1/trunk/debian/sasl2-bin.saslauthd.prerm (added)
+++ cyrus-sasl-2.1/trunk/debian/sasl2-bin.saslauthd.prerm Sun Oct 15 19:33:40 2006
@@ -1,0 +1,11 @@
+#!/bin/sh
+set -e
+
+if [ -x "/etc/init.d/saslauthd" ]; then
+ if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+ MAINTSCRIPT=yes invoke-rc.d saslauthd stop || exit $?
+ else
+ MAINTSCRIPT=yes /etc/init.d/saslauthd stop || exit $?
+ fi
+fi
+
Added: cyrus-sasl-2.1/trunk/debian/sasl2-bin.saslauthd.prostinst
URL: http://svn.debian.org/wsvn/pkg-cyrus-sasl2/cyrus-sasl-2.1/trunk/debian/sasl2-bin.saslauthd.prostinst?rev=53&op=file
==============================================================================
--- cyrus-sasl-2.1/trunk/debian/sasl2-bin.saslauthd.prostinst (added)
+++ cyrus-sasl-2.1/trunk/debian/sasl2-bin.saslauthd.prostinst Sun Oct 15 19:33:40 2006
@@ -1,0 +1,12 @@
+#!/bin/sh
+set -e
+
+if [ -x "/etc/init.d/saslauthd" ]; then
+ update-rc.d saslauthd defaults >/dev/null
+ if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+ MAINTSCRIPT=yes invoke-rc.d saslauthd start || exit $?
+ else
+ MAINTSCRIPT=yes /etc/init.d/saslauthd start || exit $?
+ fi
+fi
+
More information about the Pkg-cyrus-sasl2-commits
mailing list