r5484 - in glibc-package/branches/eglibc-2.17/debian: . debhelper.in
Author: adconrad
Date: 2013-02-07 04:53:45 +0000 (Thu, 07 Feb 2013)
New Revision: 5484
Modified:
glibc-package/branches/eglibc-2.17/debian/changelog
glibc-package/branches/eglibc-2.17/debian/debhelper.in/libc.postinst
Log:
debian/debhelper.in/libc.postinst: Add support for upstart restarts
and don't restart init when upgrading in chroots (Closes: #608903)
Modified: glibc-package/branches/eglibc-2.17/debian/changelog
===================================================================
--- glibc-package/branches/eglibc-2.17/debian/changelog 2013-02-06 21:20:51 UTC (rev 5483)
+++ glibc-package/branches/eglibc-2.17/debian/changelog 2013-02-07 04:53:45 UTC (rev 5484)
@@ -3,6 +3,8 @@
* Switch to gcc-4.7 across the board to tidy up some C99 conformance,
and force it to an experimental version at the request of Matthias.
* debian/sysdeps/arm64.mk: Remove --enable-multi-arch (LP: #1117602)
+ * debian/debhelper.in/libc.postinst: Add support for upstart restarts
+ and don't restart init when upgrading in chroots (Closes: #608903)
* debian/testsuite-checking/expected-mips*: Allow tst-audit8 to fail.
-- Adam Conrad <adconrad@0c3.net> Sun, 03 Feb 2013 22:29:39 -0700
Modified: glibc-package/branches/eglibc-2.17/debian/debhelper.in/libc.postinst
===================================================================
--- glibc-package/branches/eglibc-2.17/debian/debhelper.in/libc.postinst 2013-02-06 21:20:51 UTC (rev 5483)
+++ glibc-package/branches/eglibc-2.17/debian/debhelper.in/libc.postinst 2013-02-07 04:53:45 UTC (rev 5484)
@@ -221,9 +221,25 @@
fi # end upgrading and $preversion lt 2.17
fi # Upgrading
- # Restart init. If it fails, there is nothing we can do, so
- # just ignore the error
- telinit u 2> /dev/null || true ; sleep 1
+ # Restart init. Currently handles chroots and upstart, and assumes
+ # anything else is going to not fail at behaving like sysvinit:
+ TELINIT=yes
+ if ischroot 2>/dev/null; then
+ # Don't bother trying to re-exec init from a chroot:
+ TELINIT=no
+ else
+ if [ -x "`which initctl`" ]; then
+ UPSTART=$(initctl version 2>/dev/null | awk '/upstart/ {gsub("\)",""); print $3}')
+ if dpkg --compare-versions "$UPSTART" lt-nl 1.6.1; then
+ # This is an old upstart that can't re-exec statefully:
+ TELINIT=no
+ touch /var/run/init.upgraded
+ fi
+ fi
+ fi
+ if [ "$TELINIT" = "yes" ]; then
+ telinit u 2>/dev/null || true ; sleep 1
+ fi
fi
#DEBHELPER#
Reply to: