summaryrefslogtreecommitdiffstats
path: root/source/ap/lxc/scripts/rc.6.orig
diff options
context:
space:
mode:
Diffstat (limited to 'source/ap/lxc/scripts/rc.6.orig')
-rw-r--r--source/ap/lxc/scripts/rc.6.orig28
1 files changed, 24 insertions, 4 deletions
diff --git a/source/ap/lxc/scripts/rc.6.orig b/source/ap/lxc/scripts/rc.6.orig
index 23c280d9..e3986db8 100644
--- a/source/ap/lxc/scripts/rc.6.orig
+++ b/source/ap/lxc/scripts/rc.6.orig
@@ -37,6 +37,10 @@ case "$0" in
;;
esac
+# Restart init. This prevents init from hanging on to file handles for removed
+# glibc shared libraries in the case that those were upgraded or reinstalled.
+/sbin/telinit u
+
# Save the system time to the hardware clock using hwclock --systohc.
# This will also create or update the timestamps in /etc/adjtime.
if [ -x /sbin/hwclock ]; then
@@ -107,6 +111,11 @@ if [ -x /etc/rc.d/rc.openldap ]; then
/etc/rc.d/rc.openldap stop
fi
+# Stop the haveged entropy daemon:
+if [ -x /etc/rc.d/rc.haveged ]; then
+ /etc/rc.d/rc.haveged stop
+fi
+
# Stop D-Bus:
if [ -x /etc/rc.d/rc.messagebus ]; then
/etc/rc.d/rc.messagebus stop
@@ -115,10 +124,10 @@ fi
# Kill any processes (typically gam) that would otherwise prevent
# unmounting NFS volumes:
unset FUSER_DELAY
-for dir in $(/bin/mount | grep 'type nfs ' | cut -d ' ' -f 3 ) ; do
+for dir in $(/bin/mount | grep 'type nfs ' | sed -e 's|.* on ||g' | cut -d ' ' -f 1) ; do
echo "Killing processes holding NFS mount $dir open..."
# Background this to prevent fuser from also blocking shutdown:
- /usr/bin/fuser -k -m $dir &
+ /usr/bin/fuser -k -M -m "$dir" &
FUSER_DELAY=5
done
# If fuser was run, let it have some delay:
@@ -225,8 +234,19 @@ if [ -x /etc/rc.d/rc.cgmanager ]; then
/etc/rc.d/rc.cgmanager stop
fi
+# Umount all tmpfs mounts except /dev/shm and under /run:
+cat /proc/mounts | grep " tmpfs " | grep -v -e " /run " -e " /run/" -e " /dev/shm " | while read mount ; do
+ umount --recursive -v $(echo $mount | cut -f 2 -d ' ') 2> /dev/null
+done
+
+# Unmount local file systems:
echo "Unmounting local file systems:"
-/bin/umount -v -a -t no,proc,sysfs | tr -d ' ' | grep successfully | sed "s/:successfullyunmounted/ has been successfully unmounted./g" 2> /dev/null
+/bin/umount -v -a -t no,proc,sysfs,devtmpfs,fuse.gvfsd-fuse,tmpfs
+
+# JFS needs a sync here or the / partition cannot be remounted read-only.
+# In spite of this, it seems that a JFS root partition will always be checked
+# (and found to be clean) at boot:
+/bin/sync
echo "Remounting root filesystem read-only:"
/bin/mount -v -n -o remount,ro /
@@ -258,7 +278,7 @@ fi
# Deactivate LVM volume groups:
if [ -r /etc/lvmtab -o -d /etc/lvm/backup ]; then
echo "Deactivating LVM volume groups:"
- /sbin/vgchange -an --ignorelockingfailure
+ /sbin/vgchange -an
fi
# This never hurts again (especially since root-on-LVM always fails