Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / var / lib / dpkg / info / | server ip : 104.21.89.46 your ip : 172.69.214.217 H O M E |
Filename | /var/lib/dpkg/info/libc6:amd64.postinst |
Size | 9.8 kb |
Permission | rwxr-xr-x |
Owner | root : root |
Create time | 27-Apr-2025 09:50 |
Last modified | 12-Apr-2014 18:38 |
Last accessed | 06-Jul-2025 22:06 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
#!/bin/sh
set -e
export LC_ALL=C
type=$1
preversion=$2
package_name()
{
if dpkg --assert-multi-arch 2>/dev/null; then
echo libc6:${DPKG_MAINTSCRIPT_ARCH}
else
echo libc6
fi
}
# 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
# Handle upgrades when libc-opt package has been installed.
# When a /etc/ld.so.nohwcap file exists, ld.so only use libraries
# from /lib, and ignore all optimised libraries. This file is
# inconditionaly created in the preinst script of libc.
# Get the list of optimized packages for a given architecture
# Before removing a package from this list, make sure it appears
# in the Conflicts: line of libc.
case $(dpkg --print-architecture) in
alpha)
hwcappkgs="libc6-alphaev67"
;;
i386)
hwcappkgs="libc6-i686 libc6-xen"
;;
kfreebsd-i386)
hwcappkgs="libc0.1-i686"
;;
mipsel)
hwcappkgs="libc6-loongson2f"
;;
sparc)
hwcappkgs="libc6-sparcv9 libc6-sparcv9b"
;;
esac
# We check the version between the current installed libc and
# all optimized packages (on architectures where such packages
# exists).
all_upgraded=yes
if [ -n "$hwcappkgs" ]; then
for pkg in $hwcappkgs ; do
ver=$(dpkg-query -l $pkg 2>/dev/null | sed -e '/^[a-z][a-z]\s/!d;/^.[nc]/d;' -e "s/^..\s\+$pkg[0-9a-z:]*\s\+//;s/\s.*//g")
if [ -n "$ver" ] && [ "$ver" != "2.19-0ubuntu6" ]; then
all_upgraded=no
fi
done
fi
# If the versions of all optimized packages are the same as the libc
# one, we could remove /etc/ld.so.nohwcap. Otherwise, it will be removed
# when all optimized packages are upgraded or removed.
if [ "$all_upgraded" = yes ] ; then
rm -f /etc/ld.so.nohwcap
fi
# 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.19; then
# LP #504198; purge locales between major versions
if which locale-gen >/dev/null; then
locale-gen --purge
fi
# give a reboot notification on major version upgrades
if [ -x /usr/share/update-notifier/notify-reboot-required ]; then
/usr/share/update-notifier/notify-reboot-required
fi
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
# the following substitution processes the check variable
# and returns results in the services variable
# NSS services check: NSS_CHECK
echo -n "Checking for services that may need to be restarted..."
# Only get the ones that are installed, and configured
check=$(dpkg -s $check 2> /dev/null | egrep '^Package:|^Status:' | awk '{if ($1 ~ /^Package:/) { package=$2 } else if ($0 ~ /^Status: .* installed$/) { print package }}')
# some init scripts don't match the package names
check=$(echo $check | \
sed -e's/\bapache2.2-common\b/apache2/g' \
-e's/\bat\b/atd/g' \
-e's/\bdovecot-common\b/dovecot/g' \
-e's/\bexim4-base\b/exim4/g' \
-e's/\blpr\b/lpd/g' \
-e's/\blpr-ppd\b/lpd-ppd/g' \
-e's/\bmysql-server\b/mysql/g' \
-e's/\bsasl2-bin\b/saslauthd/g' \
)
echo
echo "Checking init scripts..."
rl=$(runlevel | sed 's/.*\ //')
for service in $check; do
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d ${service} status >/dev/null 2>/dev/null && status=0 || status=$?
if [ "$status" = "0" ] || [ "$status" = "2" ] ; then
services="$service $services"
elif [ "$status" = "100" ] ; then
echo "WARNING: init script for $service not found."
fi
else
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 -1)
fi
if [ -n "$idl" ] && [ -x $idl ]; then
services="$service $services"
fi
fi
done
# 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
# We can't just use a generic rewrite here, as it was
# samba in wheezy and smbd in jessie, which confuses.
if [ "$service" = "samba" ]; then
if [ -x /etc/init.d/smbd ] || [ -f /etc/init/smbd ]; then
service="smbd"
fi
fi
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.19
fi # Upgrading
# 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/ {print $3}' | tr -d ')')
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
# Automatically added by dh_makeshlibs
if [ "$1" = "configure" ]; then
ldconfig
fi
# End automatically added section
exit 0
set -e
export LC_ALL=C
type=$1
preversion=$2
package_name()
{
if dpkg --assert-multi-arch 2>/dev/null; then
echo libc6:${DPKG_MAINTSCRIPT_ARCH}
else
echo libc6
fi
}
# 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
# Handle upgrades when libc-opt package has been installed.
# When a /etc/ld.so.nohwcap file exists, ld.so only use libraries
# from /lib, and ignore all optimised libraries. This file is
# inconditionaly created in the preinst script of libc.
# Get the list of optimized packages for a given architecture
# Before removing a package from this list, make sure it appears
# in the Conflicts: line of libc.
case $(dpkg --print-architecture) in
alpha)
hwcappkgs="libc6-alphaev67"
;;
i386)
hwcappkgs="libc6-i686 libc6-xen"
;;
kfreebsd-i386)
hwcappkgs="libc0.1-i686"
;;
mipsel)
hwcappkgs="libc6-loongson2f"
;;
sparc)
hwcappkgs="libc6-sparcv9 libc6-sparcv9b"
;;
esac
# We check the version between the current installed libc and
# all optimized packages (on architectures where such packages
# exists).
all_upgraded=yes
if [ -n "$hwcappkgs" ]; then
for pkg in $hwcappkgs ; do
ver=$(dpkg-query -l $pkg 2>/dev/null | sed -e '/^[a-z][a-z]\s/!d;/^.[nc]/d;' -e "s/^..\s\+$pkg[0-9a-z:]*\s\+//;s/\s.*//g")
if [ -n "$ver" ] && [ "$ver" != "2.19-0ubuntu6" ]; then
all_upgraded=no
fi
done
fi
# If the versions of all optimized packages are the same as the libc
# one, we could remove /etc/ld.so.nohwcap. Otherwise, it will be removed
# when all optimized packages are upgraded or removed.
if [ "$all_upgraded" = yes ] ; then
rm -f /etc/ld.so.nohwcap
fi
# 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.19; then
# LP #504198; purge locales between major versions
if which locale-gen >/dev/null; then
locale-gen --purge
fi
# give a reboot notification on major version upgrades
if [ -x /usr/share/update-notifier/notify-reboot-required ]; then
/usr/share/update-notifier/notify-reboot-required
fi
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
# the following substitution processes the check variable
# and returns results in the services variable
# NSS services check: NSS_CHECK
echo -n "Checking for services that may need to be restarted..."
# Only get the ones that are installed, and configured
check=$(dpkg -s $check 2> /dev/null | egrep '^Package:|^Status:' | awk '{if ($1 ~ /^Package:/) { package=$2 } else if ($0 ~ /^Status: .* installed$/) { print package }}')
# some init scripts don't match the package names
check=$(echo $check | \
sed -e's/\bapache2.2-common\b/apache2/g' \
-e's/\bat\b/atd/g' \
-e's/\bdovecot-common\b/dovecot/g' \
-e's/\bexim4-base\b/exim4/g' \
-e's/\blpr\b/lpd/g' \
-e's/\blpr-ppd\b/lpd-ppd/g' \
-e's/\bmysql-server\b/mysql/g' \
-e's/\bsasl2-bin\b/saslauthd/g' \
)
echo
echo "Checking init scripts..."
rl=$(runlevel | sed 's/.*\ //')
for service in $check; do
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d ${service} status >/dev/null 2>/dev/null && status=0 || status=$?
if [ "$status" = "0" ] || [ "$status" = "2" ] ; then
services="$service $services"
elif [ "$status" = "100" ] ; then
echo "WARNING: init script for $service not found."
fi
else
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 -1)
fi
if [ -n "$idl" ] && [ -x $idl ]; then
services="$service $services"
fi
fi
done
# 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
# We can't just use a generic rewrite here, as it was
# samba in wheezy and smbd in jessie, which confuses.
if [ "$service" = "samba" ]; then
if [ -x /etc/init.d/smbd ] || [ -f /etc/init/smbd ]; then
service="smbd"
fi
fi
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.19
fi # Upgrading
# 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/ {print $3}' | tr -d ')')
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
# Automatically added by dh_makeshlibs
if [ "$1" = "configure" ]; then
ldconfig
fi
# End automatically added section
exit 0