/usr/src/glibc/debian/debhelper.in/libc.postinst is in eglibc-source 2.15-0ubuntu10.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | #!/bin/sh
set -e
export LC_ALL=C
type=$1
preversion=$2
package_name()
{
echo LIBC
}
# element() is a helper function for file-rc:
element() {
local element list IFS
element="$1"
[ "$2" = "in" ] && shift
list="$2"
[ "$list" = "-" ] && return 1
[ "$list" = "*" ] && return 0
IFS=","
set -- $list
case $element in
"$1"|"$2"|"$3"|"$4"|"$5"|"$6"|"$7"|"$8"|"$9")
return 0
esac
return 1
}
# filerc (runlevel, service) returns /etc/init.d/service, if service is
# running in $runlevel:
filerc() {
local runlevel basename
runlevel=$1
basename=$2
while read LINE
do
case $LINE in
\#*|"") continue
esac
set -- $LINE
SORT_NO="$1"; STOP="$2"; START="$3"; CMD="$4"
[ "$CMD" = "/etc/init.d/$basename" ] || continue
if element "$runlevel" in "$START" || element "S" in "$START"
then
echo "/etc/init.d/$basename"
return 0
fi
done < /etc/runlevel.conf
echo ""
}
checkpkgver () {
local status pkg
pkg=$1
status=$(dpkg -s $pkg 2>/dev/null | grep ^Status: | sed -e 's/^Status: \(.*\) \(.*\) \(.*\)/\3/g')
if [ -n "$status" ] && [ "$status" != "not-installed" ] && [ "$status" != "config-files" ]; then
echo $(dpkg -s $pkg 2>/dev/null | grep ^Version: | sed -e 's/^Version: *//');
fi
}
if [ "$type" = "configure" ]
then
# Add support for /etc/ld.so.conf.d
if [ -e /etc/ld.so.conf ]; then
[ -z "$(tail -n 1 /etc/ld.so.conf)" ] || echo >> /etc/ld.so.conf
else
touch /etc/ld.so.conf
fi
if ! grep -q '^include /etc/ld.so.conf.d/.*\.conf$' /etc/ld.so.conf ; then
echo 'include /etc/ld.so.conf.d/*.conf' >> /etc/ld.so.conf
fi
# We don't use a registry anymore, remove the old file
rm -f /etc/ld.so.hwcappkgs
# /etc/ld.so.nohwcap code: NOHWCAP
# Load debconf module if available
if [ -f /usr/share/debconf/confmodule ] ; then
. /usr/share/debconf/confmodule
fi
if [ -n "$preversion" ]; then
if [ ! -d /var/mail ] && [ ! -L /var/mail ]; then
ln -sf spool/mail /var/mail
fi
if dpkg --compare-versions "$preversion" lt 2.15-0ubuntu1; then
# LP #504198
if which locale-gen >/dev/null; then
locale-gen --purge
fi
fi
if dpkg --compare-versions "$preversion" lt 2.15-0ubuntu3; then
if [ -x /usr/share/update-notifier/notify-reboot-required ]; then
/usr/share/update-notifier/notify-reboot-required
fi
fi
if dpkg --compare-versions "$preversion" lt 2.15; then
check=""
[ -f /var/run/services.need_restart ] && check=$(cat /var/run/services.need_restart 2>/dev/null)
# Change service names back into package names, so that we can
# double-check package installation.
check=$(echo "$check" | \
sed -e's/\bapache2\b/apache2.2-common/g' \
-e's/\batd\b/at/g' \
-e's/\bdovecot\b/dovecot-common/g' \
-e's/\bexim4\b/exim4-base/g' \
-e's/\blpd\b/lpr/g' \
-e's/\blpd-ppd\b/lpr-ppd/g' \
-e's/\bmysql\b/mysql-server/g' \
-e's/\bsaslauthd\b/sasl2-bin/g' \
)
# Check to see which of the services that were running at unpack
# time are still around
# NSS services check: NSS_CHECK
# If there are services that we *stopped* in the preinst, don't
# forget to restart them now
if [ -e /var/run/services.need_start ]; then
services="$(cat /var/run/services.need_start) $services"
fi
if [ -n "$services" ]; then
echo "Restarting services possibly affected by the upgrade:"
failed=""
for service in $services; do
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
idl="invoke-rc.d ${service}"
idlopt="restart"
elif [ -f /usr/share/file-rc/rc ] || [ -f /usr/lib/file-rc/rc ] && [ -f /etc/runlevel.conf ]; then
idl=$(filerc $rl $service)
idlopt="restart"
else
idl=$(ls /etc/rc${rl}.d/S??${service} 2> /dev/null | head -1)
idlopt="restart"
fi
echo -n " $service: restarting..."
if $idl $idlopt > /dev/null 2>&1; then
echo "done."
else
echo "FAILED! ($?)"
failed="$service $failed"
fi
done
echo
if [ -n "$failed" ]; then
if [ -f /usr/share/debconf/confmodule ] ; then
db_fset glibc/restart-failed seen false
db_subst glibc/restart-failed services "$failed"
if [ "$RELEASE_UPGRADE_MODE" = desktop ]; then
db_input medium glibc/restart-failed || true
else
db_input critical glibc/restart-failed || true
fi
db_go || true
else
echo "The following services failed to start: $failed"
echo
echo "You will need to start these manually by running \`/etc/init.d/<service> start'"
echo "If the service still fails to start, you may need to file a bug on"
echo "$(package_name) or the service involved."
frontend=`echo "$DEBIAN_FRONTEND" | tr '[:upper:]' '[:lower:]'`
if [ "$frontend" != noninteractive ]; then
echo
echo -n "Press ENTER to continue: "
read foo
fi
fi
else
echo "Services restarted successfully."
rm -f /var/run/services.need_start /var/run/services.need_restart
fi
# Shut down the frontend, to make sure none of the
# restarted services keep a connection open to it
if [ -f /usr/share/debconf/confmodule ] ; then
db_stop
fi
else
echo "Nothing to restart."
fi
fi # end upgrading and $preversion lt 2.15
fi # Upgrading
# Upstart cannot be restarted without losing all of its state, so
# umountroot will run 'telinit u' on reboot if this file exists
touch /var/run/init.upgraded
fi
#DEBHELPER#
exit 0
|