[Pkg-openssl-changes] r134 - openssl/trunk/debian

Kurt Roeckx kroeckx at costa.debian.org
Mon May 1 13:29:52 UTC 2006


Author: kroeckx
Date: 2006-05-01 13:29:51 +0000 (Mon, 01 May 2006)
New Revision: 134

Modified:
   openssl/trunk/debian/changelog
   openssl/trunk/debian/libssl0.9.8.postinst
Log:
Use invoke-rc.d when it's available.


Modified: openssl/trunk/debian/changelog
===================================================================
--- openssl/trunk/debian/changelog	2006-05-01 12:30:42 UTC (rev 133)
+++ openssl/trunk/debian/changelog	2006-05-01 13:29:51 UTC (rev 134)
@@ -18,6 +18,7 @@
     wasn't working.
   * libssl0.9.8.postinst: Add workaround to find the name of the init 
     script for proftpd and dovecot.
+  * libssl0.9.8.postinst: Use invoke-rc.d when it's available.
 
  -- Kurt Roeckx <kurt at roeckx.be>  Thu,  6 Apr 2006 20:34:07 +0200
 

Modified: openssl/trunk/debian/libssl0.9.8.postinst
===================================================================
--- openssl/trunk/debian/libssl0.9.8.postinst	2006-05-01 12:30:42 UTC (rev 133)
+++ openssl/trunk/debian/libssl0.9.8.postinst	2006-05-01 13:29:51 UTC (rev 134)
@@ -84,19 +84,29 @@
             # dovecot-common ships its init script, but the
 	    # script name is dovecot for dovecot-{imapd,pop3d}.
 	    check=$(echo $check | sed 's/dovecot-common/dovecot/g')
+	    echo "done."
 
-	    rl=$(runlevel | awk '{print $2}')
+	    echo "Checking init scripts..."
 	    for service in $check; do
-		if [ -f /usr/share/file-rc/rc -o -f /usr/lib/file-rc/rc ] && [ -f /etc/runlevel.conf ]; then
-		    idl=$(filerc $rl $service)
+		if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+		   idl=$(ls /etc/init.d/${service} 2> /dev/null | head -n 1)
+		   if [ -n "$idl" ] && [ -x $idl ]; then
+			services="$service $services"
+		   else
+			echo "WARNING: init script for $service not found."
+		   fi
 		else
-		    idl=$(ls /etc/rc${rl}.d/S??${service} 2> /dev/null | head -n 1)
+		    if [ -f /usr/share/file-rc/rc ] || [ -f /usr/lib/file-rc/rc ] && [ -f /etc/runlevel.conf ]; then
+
+			idl=$(filerc $rl $service)
+		    else
+			idl=$(ls /etc/rc${rl}.d/S??${service} 2> /dev/null | head -n 1)
+		    fi
+		    if [ -n "$idl" ] && [ -x $idl ]; then
+		        services="$service $services"
+		    fi
 		fi
-		if [ -n "$idl" ] && [ -x $idl ]; then
-		    services="$service $services"
-		fi
 	    done
-	    echo "done."
 	    if [ -n "$services" ]; then
 		db_version 2.0
 
@@ -119,7 +129,16 @@
 		if [ "$answer" = yes ] && [ "$services" != "" ]; then
 		    echo "Restarting services possibly affected by the upgrade:"
 		    failed=""
+		    rl=$(runlevel | sed 's/.*\ //')
 		    for service in $services; do
+			if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+			    idl="invoke-rc.d ${service}"
+			elif [ -f /usr/share/file-rc/rc ] || [ -f /usr/lib/file-rc/rc ] && [ -f /etc/runlevel.conf ]; then
+			    idl=$(filerc $rl $service)
+			else
+			    idl=$(ls /etc/rc${rl}.d/S??${service} 2> /dev/null | head -n 1)
+			fi
+
 			idl=$(ls /etc/rc${rl}.d/S??${service} 2> /dev/null | head -n 1)
 			echo -n "  $service: stopping..."
 			$idl stop > /dev/null 2>&1 || true
@@ -145,6 +164,8 @@
 		    fi
 		    echo
 		fi
+	    else
+		echo "Nothing to restart."
 	    fi
 	fi # end upgrading and $2 lt 0.9.8-3
     fi # Upgrading




More information about the Pkg-openssl-changes mailing list