slackware-current/source/a/sysvinit-scripts/scripts/rc.6

315 lines
8.9 KiB
Groff
Raw Normal View History

#! /bin/sh
#
# rc.6 This file is executed by init when it goes into runlevel
# 0 (halt) or runlevel 6 (reboot). It kills all processes,
# unmounts file systems and then either halts or reboots.
#
# Version: @(#)/etc/rc.d/rc.6 2.47 Sat Jan 13 13:37:26 PST 2001
#
# Author: Miquel van Smoorenburg <miquels@drinkel.nl.mugnet.org>
# Modified by: Patrick J. Volkerding, <volkerdi@slackware.com>
#
# Set the path.
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
# If there are SystemV init scripts for this runlevel, run them.
if [ -x /etc/rc.d/rc.sysvinit ]; then
/etc/rc.d/rc.sysvinit
fi
# Set linefeed mode to avoid staircase effect.
/bin/stty onlcr
echo "Running shutdown script $0:"
# Find out how we were called.
case "$0" in
*0)
shutdown_command="halt"
;;
*6)
shutdown_command=reboot
;;
*)
echo "$0: call me as \"rc.0\" or \"rc.6\" please!"
exit 1
;;
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
# Check for a broken motherboard RTC clock (where ioports for rtc are
# unknown) to prevent hwclock causing a hang:
if ! grep -q " : rtc" /proc/ioports ; then
CLOCK_OPT="--directisa"
fi
if [ /etc/adjtime -nt /etc/hardwareclock ]; then
if grep -q "^LOCAL" /etc/adjtime ; then
echo "Saving system time to the hardware clock (localtime)."
else
echo "Saving system time to the hardware clock (UTC)."
fi
/sbin/hwclock $CLOCK_OPT --systohc
elif grep -q "^UTC" /etc/hardwareclock 2> /dev/null ; then
echo "Saving system time to the hardware clock (UTC)."
if [ ! -r /etc/adjtime ]; then
echo "Creating system time correction file /etc/adjtime."
fi
/sbin/hwclock $CLOCK_OPT --utc --systohc
else
echo "Saving system time to the hardware clock (localtime)."
if [ ! -r /etc/adjtime ]; then
echo "Creating system time correction file /etc/adjtime."
fi
/sbin/hwclock $CLOCK_OPT --localtime --systohc
fi
fi
# Run any local shutdown scripts:
if [ -x /etc/rc.d/rc.local_shutdown ]; then
/etc/rc.d/rc.local_shutdown stop
fi
# Stop the Apache web server:
if [ -x /etc/rc.d/rc.httpd ]; then
/etc/rc.d/rc.httpd stop
fi
# Stop the MySQL database:
if [ -x /etc/rc.d/rc.mysqld -a -r /var/run/mysql/mysql.pid ]; then
/etc/rc.d/rc.mysqld stop
fi
# Stop the Samba server:
if [ -x /etc/rc.d/rc.samba ]; then
/etc/rc.d/rc.samba stop
fi
# Shut down the NFS server:
if [ -x /etc/rc.d/rc.nfsd ]; then
/etc/rc.d/rc.nfsd stop
fi
# Shut down the SSH server:
if [ -x /etc/rc.d/rc.sshd ]; then
/etc/rc.d/rc.sshd stop
fi
# Shut down the SASL authentication daemon:
if [ -x /etc/rc.d/rc.saslauthd ]; then
/etc/rc.d/rc.saslauthd stop
fi
# Shut down OpenLDAP:
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
fi
# Kill any processes (typically gam) that would otherwise prevent
# unmounting NFS volumes:
unset FUSER_DELAY
Wed Jul 25 03:50:17 UTC 2018 a/kernel-generic-4.14.57-x86_64-1.txz: Upgraded. a/kernel-huge-4.14.57-x86_64-1.txz: Upgraded. a/kernel-modules-4.14.57-x86_64-1.txz: Upgraded. a/shadow-4.2.1-x86_64-5.txz: Rebuilt. adduser: added "input" to additional user groups. Thanks to stormtracknole. a/sysvinit-scripts-2.1-noarch-14.txz: Rebuilt. Handle remote (NFS, etc.) mounts with spaces in the name. Thanks to upnort. d/kernel-headers-4.14.57-x86-1.txz: Upgraded. d/parallel-20180722-noarch-1.txz: Upgraded. d/rust-1.27.2-x86_64-1.txz: Upgraded. d/subversion-1.10.2-x86_64-1.txz: Upgraded. k/kernel-source-4.14.57-noarch-1.txz: Upgraded. l/libgphoto2-2.5.19-x86_64-1.txz: Upgraded. l/libzip-1.5.1-x86_64-4.txz: Rebuilt. Make sure that the API-CHANGES file is included in the package documentation. x/xf86-video-r128-6.11.0-x86_64-1.txz: Upgraded. x/xorg-server-1.20.0-x86_64-3.txz: Rebuilt. Applied some patches that other distributions have been using for a while: Fix glamor so that the return value from glamor_fds_from_pixmap matches what's expected (thanks to Darth Vader for pointing out these patches). Autobind secondary GPUs to the master as output sink / offload source. This seems like a beneficial patch until/unless DEs start to handle this. For nvidia cards, if they are GeForce 8 or newer use the modesetting driver by default. Seems to be recommmended by upstream where they indicate that fixes going into nouveau are primarily to target older cards for legacy support and that the modesetting ddx is preferable for newer ones: https://bugs.freedesktop.org/show_bug.cgi?id=94844 x/xorg-server-xephyr-1.20.0-x86_64-3.txz: Rebuilt. x/xorg-server-xnest-1.20.0-x86_64-3.txz: Rebuilt. x/xorg-server-xvfb-1.20.0-x86_64-3.txz: Rebuilt. isolinux/initrd.img: Rebuilt. Use ter-v14v.psf.gz as the consolefont. It supports more character sets, and the larger font was causing wraparound on UEFI (at least on bare metal here). kernels/*: Upgraded. usb-and-pxe-installers/usbboot.img: Rebuilt.
2018-07-25 05:50:17 +02:00
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:
Wed Jul 25 03:50:17 UTC 2018 a/kernel-generic-4.14.57-x86_64-1.txz: Upgraded. a/kernel-huge-4.14.57-x86_64-1.txz: Upgraded. a/kernel-modules-4.14.57-x86_64-1.txz: Upgraded. a/shadow-4.2.1-x86_64-5.txz: Rebuilt. adduser: added "input" to additional user groups. Thanks to stormtracknole. a/sysvinit-scripts-2.1-noarch-14.txz: Rebuilt. Handle remote (NFS, etc.) mounts with spaces in the name. Thanks to upnort. d/kernel-headers-4.14.57-x86-1.txz: Upgraded. d/parallel-20180722-noarch-1.txz: Upgraded. d/rust-1.27.2-x86_64-1.txz: Upgraded. d/subversion-1.10.2-x86_64-1.txz: Upgraded. k/kernel-source-4.14.57-noarch-1.txz: Upgraded. l/libgphoto2-2.5.19-x86_64-1.txz: Upgraded. l/libzip-1.5.1-x86_64-4.txz: Rebuilt. Make sure that the API-CHANGES file is included in the package documentation. x/xf86-video-r128-6.11.0-x86_64-1.txz: Upgraded. x/xorg-server-1.20.0-x86_64-3.txz: Rebuilt. Applied some patches that other distributions have been using for a while: Fix glamor so that the return value from glamor_fds_from_pixmap matches what's expected (thanks to Darth Vader for pointing out these patches). Autobind secondary GPUs to the master as output sink / offload source. This seems like a beneficial patch until/unless DEs start to handle this. For nvidia cards, if they are GeForce 8 or newer use the modesetting driver by default. Seems to be recommmended by upstream where they indicate that fixes going into nouveau are primarily to target older cards for legacy support and that the modesetting ddx is preferable for newer ones: https://bugs.freedesktop.org/show_bug.cgi?id=94844 x/xorg-server-xephyr-1.20.0-x86_64-3.txz: Rebuilt. x/xorg-server-xnest-1.20.0-x86_64-3.txz: Rebuilt. x/xorg-server-xvfb-1.20.0-x86_64-3.txz: Rebuilt. isolinux/initrd.img: Rebuilt. Use ter-v14v.psf.gz as the consolefont. It supports more character sets, and the larger font was causing wraparound on UEFI (at least on bare metal here). kernels/*: Upgraded. usb-and-pxe-installers/usbboot.img: Rebuilt.
2018-07-25 05:50:17 +02:00
/usr/bin/fuser -k -M -m "$dir" &
FUSER_DELAY=5
done
# If fuser was run, let it have some delay:
if [ ! -z "$FUSER_DELAY" ]; then
sleep $FUSER_DELAY
fi
# Unmount any NFS, SMB, or CIFS filesystems:
echo "Unmounting remote filesystems:"
/bin/umount -v -a -l -f -r -t nfs,smbfs,cifs | tr -d ' ' | grep successfully | sed "s/:successfullyunmounted/ has been successfully unmounted./g"
# Try to shut down pppd:
PS="$(ps ax)"
if echo "$PS" | /bin/grep -q -w pppd ; then
if [ -x /usr/sbin/ppp-off ]; then
/usr/sbin/ppp-off
fi
fi
# Shut down YP services:
if [ -x /etc/rc.d/rc.yp ]; then
if grep -wq stop /etc/rc.d/rc.yp ; then
/etc/rc.d/rc.yp stop
fi
fi
# Bring down the networking system, but first make sure that this
# isn't a diskless client with the / partition mounted via NFS:
if ! /bin/mount | /bin/grep -q 'on / type nfs' ; then
if [ -x /etc/rc.d/rc.inet1 ]; then
/etc/rc.d/rc.inet1 stop
fi
fi
# In case dhcpcd might have been manually started on the command line,
# look for the .pid file, and shut dhcpcd down if it's found:
if /bin/ls /etc/dhcpc/*.pid 1> /dev/null 2> /dev/null ; then
/sbin/dhcpcd -k 1> /dev/null 2> /dev/null
# A little time for /etc/resolv.conf and/or other files to
# restore themselves.
sleep 2
fi
# Shut down PCMCIA devices:
if [ -x /etc/rc.d/rc.pcmcia ]; then
/etc/rc.d/rc.pcmcia stop
# The cards might need a little extra time here to deactivate:
/bin/sleep 5
fi
# Turn off process accounting:
if [ -x /sbin/accton -a -r /var/log/pacct ]; then
/sbin/accton off
fi
# Terminate acpid before syslog:
if [ -x /etc/rc.d/rc.acpid -a -r /var/run/acpid.pid ]; then # quit
/etc/rc.d/rc.acpid stop
fi
# Stop udev:
if [ -x /etc/rc.d/rc.udev ]; then
/etc/rc.d/rc.udev force-stop
fi
# Kill all remaining processes.
OMITPIDS="$(for p in $(pgrep mdmon); do echo -o $p; done)" # Don't kill mdmon
if [ ! "$1" = "fast" ]; then
echo "Sending all processes the SIGTERM signal."
/sbin/killall5 -15 $OMITPIDS
/bin/sleep 5
echo "Sending all processes the SIGKILL signal."
/sbin/killall5 -9 $OMITPIDS
fi
# Try to turn off quota.
if /bin/grep -q quota /etc/fstab ; then
if [ -x /sbin/quotaoff ]; then
echo "Turning off filesystem quotas."
/sbin/quotaoff -a
fi
fi
# Carry a random seed between reboots.
echo "Saving random seed from /dev/urandom in /etc/random-seed."
# Use the pool size from /proc, or 4096 bits:
if [ -r /proc/sys/kernel/random/poolsize ]; then
/bin/dd if=/dev/urandom of=/etc/random-seed count=1 bs=$(expr $(cat /proc/sys/kernel/random/poolsize) / 8) 2> /dev/null
else
/bin/dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2> /dev/null
fi
/bin/chmod 600 /etc/random-seed
# Before unmounting file systems write a reboot or halt record to wtmp.
$shutdown_command -w
# Turn off swap:
echo "Turning off swap."
/sbin/swapoff -a
/bin/sync
# Stop cgmanager and cgproxy:
if [ -x /etc/rc.d/rc.cgmanager ]; then
/etc/rc.d/rc.cgmanager stop
fi
Thu Nov 22 05:56:56 UTC 2018 a/kernel-generic-4.19.3-x86_64-1.txz: Upgraded. a/kernel-huge-4.19.3-x86_64-1.txz: Upgraded. a/kernel-modules-4.19.3-x86_64-1.txz: Upgraded. a/openssl-solibs-1.1.1a-x86_64-1.txz: Upgraded. a/sysvinit-scripts-2.1-noarch-21.txz: Rebuilt. rc.S: Don't run rc.fuse - udev takes care of the FUSE module and filesystem. rc.S: Support replacing the /etc/mtab file with a symlink to /proc/mounts. rc.6: Show more information when unmounting filesystems at shutdown. ap/ghostscript-9.26-x86_64-1.txz: Upgraded. ap/mariadb-10.3.11-x86_64-1.txz: Upgraded. This update fixes bugs and security issues. For more information, see: https://mariadb.com/kb/en/library/mariadb-10311-release-notes/ https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3282 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2016-9843 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3174 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3143 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3156 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3251 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3185 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3277 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3162 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3173 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3200 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3284 (* Security fix *) d/cmake-3.13.0-x86_64-1.txz: Upgraded. d/git-2.19.2-x86_64-1.txz: Upgraded. d/kernel-headers-4.14.63-x86-1.txz: Upgraded. d/kernel-headers-4.19.3-x86-1.txz: Upgraded. d/vala-0.42.3-x86_64-1.txz: Added. k/kernel-source-4.19.3-noarch-1.txz: Upgraded. l/adwaita-icon-theme-3.30.0-noarch-1.txz: Upgraded. l/at-spi2-atk-2.30.0-x86_64-1.txz: Upgraded. l/at-spi2-core-2.30.0-x86_64-1.txz: Upgraded. l/atk-2.30.0-x86_64-1.txz: Upgraded. l/atkmm-2.28.0-x86_64-1.txz: Upgraded. l/dconf-0.28.0-x86_64-1.txz: Upgraded. dconf and dconf-editor require Vala; the alternative would be to try to stick with the old versions forever, and we don't want to do that. l/dconf-editor-3.30.2-x86_64-1.txz: Upgraded. l/gcr-3.28.0-x86_64-3.txz: Rebuilt. Recompiled to add Vala bindings. l/gdk-pixbuf2-2.38.0-x86_64-1.txz: Upgraded. l/gexiv2-0.10.9-x86_64-1.txz: Upgraded. l/glib-networking-2.58.0-x86_64-1.txz: Upgraded. l/glib2-2.58.1-x86_64-1.txz: Upgraded. l/glibmm-2.58.0-x86_64-1.txz: Upgraded. l/gobject-introspection-1.58.0-x86_64-1.txz: Upgraded. l/gtk+3-3.24.1-x86_64-1.txz: Upgraded. l/gtkmm3-3.24.0-x86_64-1.txz: Upgraded. l/gvfs-1.38.1-x86_64-1.txz: Upgraded. l/libcap-2.26-x86_64-1.txz: Upgraded. l/libpsl-0.20.1-x86_64-1.txz: Added. Required by libsoup. l/libsoup-2.64.2-x86_64-1.txz: Upgraded. l/pangomm-2.42.0-x86_64-1.txz: Upgraded. l/pygobject3-3.30.2-x86_64-1.txz: Upgraded. l/vte-0.54.2-x86_64-1.txz: Upgraded. n/openssl-1.1.1a-x86_64-1.txz: Upgraded. This update fixes timing side channel attacks on DSA and ECDSA signature generation that could allow an attacker to recover the private key. For more information, see: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0734 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0735 (* Security fix *) x/pixman-0.36.0-x86_64-1.txz: Upgraded. xfce/xfce4-terminal-0.8.7.4-x86_64-2.txz: Rebuilt. isolinux/initrd.img: Rebuilt. kernels/*: Upgraded. usb-and-pxe-installers/usbboot.img: Rebuilt.
2018-11-22 06:56:56 +01:00
# Unmount local file systems:
echo "Unmounting local file systems:"
Thu Nov 22 05:56:56 UTC 2018 a/kernel-generic-4.19.3-x86_64-1.txz: Upgraded. a/kernel-huge-4.19.3-x86_64-1.txz: Upgraded. a/kernel-modules-4.19.3-x86_64-1.txz: Upgraded. a/openssl-solibs-1.1.1a-x86_64-1.txz: Upgraded. a/sysvinit-scripts-2.1-noarch-21.txz: Rebuilt. rc.S: Don't run rc.fuse - udev takes care of the FUSE module and filesystem. rc.S: Support replacing the /etc/mtab file with a symlink to /proc/mounts. rc.6: Show more information when unmounting filesystems at shutdown. ap/ghostscript-9.26-x86_64-1.txz: Upgraded. ap/mariadb-10.3.11-x86_64-1.txz: Upgraded. This update fixes bugs and security issues. For more information, see: https://mariadb.com/kb/en/library/mariadb-10311-release-notes/ https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3282 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2016-9843 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3174 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3143 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3156 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3251 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3185 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3277 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3162 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3173 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3200 https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3284 (* Security fix *) d/cmake-3.13.0-x86_64-1.txz: Upgraded. d/git-2.19.2-x86_64-1.txz: Upgraded. d/kernel-headers-4.14.63-x86-1.txz: Upgraded. d/kernel-headers-4.19.3-x86-1.txz: Upgraded. d/vala-0.42.3-x86_64-1.txz: Added. k/kernel-source-4.19.3-noarch-1.txz: Upgraded. l/adwaita-icon-theme-3.30.0-noarch-1.txz: Upgraded. l/at-spi2-atk-2.30.0-x86_64-1.txz: Upgraded. l/at-spi2-core-2.30.0-x86_64-1.txz: Upgraded. l/atk-2.30.0-x86_64-1.txz: Upgraded. l/atkmm-2.28.0-x86_64-1.txz: Upgraded. l/dconf-0.28.0-x86_64-1.txz: Upgraded. dconf and dconf-editor require Vala; the alternative would be to try to stick with the old versions forever, and we don't want to do that. l/dconf-editor-3.30.2-x86_64-1.txz: Upgraded. l/gcr-3.28.0-x86_64-3.txz: Rebuilt. Recompiled to add Vala bindings. l/gdk-pixbuf2-2.38.0-x86_64-1.txz: Upgraded. l/gexiv2-0.10.9-x86_64-1.txz: Upgraded. l/glib-networking-2.58.0-x86_64-1.txz: Upgraded. l/glib2-2.58.1-x86_64-1.txz: Upgraded. l/glibmm-2.58.0-x86_64-1.txz: Upgraded. l/gobject-introspection-1.58.0-x86_64-1.txz: Upgraded. l/gtk+3-3.24.1-x86_64-1.txz: Upgraded. l/gtkmm3-3.24.0-x86_64-1.txz: Upgraded. l/gvfs-1.38.1-x86_64-1.txz: Upgraded. l/libcap-2.26-x86_64-1.txz: Upgraded. l/libpsl-0.20.1-x86_64-1.txz: Added. Required by libsoup. l/libsoup-2.64.2-x86_64-1.txz: Upgraded. l/pangomm-2.42.0-x86_64-1.txz: Upgraded. l/pygobject3-3.30.2-x86_64-1.txz: Upgraded. l/vte-0.54.2-x86_64-1.txz: Upgraded. n/openssl-1.1.1a-x86_64-1.txz: Upgraded. This update fixes timing side channel attacks on DSA and ECDSA signature generation that could allow an attacker to recover the private key. For more information, see: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0734 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0735 (* Security fix *) x/pixman-0.36.0-x86_64-1.txz: Upgraded. xfce/xfce4-terminal-0.8.7.4-x86_64-2.txz: Rebuilt. isolinux/initrd.img: Rebuilt. kernels/*: Upgraded. usb-and-pxe-installers/usbboot.img: Rebuilt.
2018-11-22 06:56:56 +01:00
/bin/umount -v -a -t no,proc,sysfs,devtmpfs,fuse.gvfsd-fuse
Thu Sep 13 21:41:51 UTC 2018 a/sysvinit-scripts-2.1-noarch-20.txz: Rebuilt. rc.6: it was reported by birdboy that JFS is not properly unmounted unless the order of unmounting local filesystems followed by remounting the root filesystem read-only is inverted. I tried that, and although it did get rid of a "/ filesystem is busy" error during shutdown, the JFS / filesystem was still checked at boot (and found to be clean). I believe that the existing order of unmounting non-root filesystems followed by remounting the root filesystem as read-only is the correct order, and found that putting another sync between these also gets rid of the error on shutdown, so I've done that. When using JFS as the root filesystem there's still another similar error message that's generated earlier in the boot, though. I'm unable to find any way to shut down a JFS root partition in a way that leaves it clean enough that fsck will not check it at boot, but it is always found to be clean so this should only be cosmetic. I recall this behavior of JFS going all the way back to when it was first added to the kernel. If anyone has a better fix, I'll take a look at it, but in my opinion it's not really anything to worry about. ap/ghostscript-9.25-x86_64-1.txz: Upgraded. This release fixes problems with argument handling, some unintended results of the security fixes to the SAFER file access restrictions (specifically accessing ICC profile files), and some additional security issues over the recent 9.24 release. For more information, see: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-16509 (* Security fix *) ap/squashfs-tools-20180612_6e242dc-x86_64-1.txz: Upgraded. Linked against libzstd.so.1. Thanks to alienBOB. ap/sudo-1.8.25p1-x86_64-1.txz: Upgraded. d/binutils-2.31.1-x86_64-4.txz: Rebuilt. Since baldzhang has pointed out a valid use case for windres on Linux, we are restoring the "Windows only" utilities, as none of them are very large and there may be valid uses for the other ones as well. l/freetype-2.9.1-x86_64-2.txz: Rebuilt. Patched to build properly if windres is present on the machine. l/sg3_utils-1.44-x86_64-1.txz: Upgraded. l/zstd-1.3.5-x86_64-1.txz: Added. Thanks to alienBOB. xfce/tumbler-0.2.3-x86_64-1.txz: Upgraded. isolinux/initrd.img: Rebuilt. Use the ter-114v terminus font. It has been reported that the font we were using (ter-v14v) restricts the available console colors from 16 to 8 due to needing an extra bit for the higher number of available glyphs (though in testing here I couldn't see any difference). The new font covers ISO8859-1, ISO8859-15, and Windows-1252 codepages. I'm still not sure it's the best choice, so additional input is welcomed. Thanks to bormant. usb-and-pxe-installers/usbboot.img: Rebuilt. Use the ter-114v terminus font.
2018-09-13 23:41:51 +02:00
# 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 /
# This never hurts:
/bin/sync
# Close any volumes opened by cryptsetup:
if [ -f /etc/crypttab -a -x /sbin/cryptsetup ]; then
cat /etc/crypttab | grep -v "^#" | grep -v "^$" | while read line; do
# NOTE: we only support LUKS formatted volumes (except for swap)!
LUKS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f1 -d' ')
DEV=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f2 -d' ')
OPTS=$(echo $line | tr '\t' ' ' | tr -s ' ' | cut -f4 -d' ')
if /sbin/cryptsetup isLuks $DEV 2>/dev/null ; then
echo "Locking LUKS crypt volume '${LUKS}':"
/sbin/cryptsetup luksClose ${LUKS}
elif echo $OPTS | grep -wq swap ; then
# If any of the volumes was used as encrypted swap,
# then run mkswap on the underlying device -
# in case other Linux installations on this computer should use it:
echo "Erasing encrypted swap '${LUKS}' and restoring normal swap on ${DEV}:"
/sbin/cryptsetup remove ${LUKS}
mkswap $DEV
fi
done
fi
# Deactivate LVM volume groups:
if [ -r /etc/lvmtab -o -d /etc/lvm/backup ]; then
echo "Deactivating LVM volume groups:"
/sbin/vgchange -an --ignorelockingfailure
fi
# This never hurts again (especially since root-on-LVM always fails
# to deactivate the / logical volume... but at least it was
# remounted as read-only first)
/bin/sync
# sleep 3 fixes problems with some hard drives that don't
# otherwise finish syncing before reboot or poweroff
/bin/sleep 3
# This is to ensure all processes have completed on SMP machines:
wait
if [ -x /sbin/genpowerd ]; then
# See if this is a powerfail situation:
if /bin/egrep -q "FAIL|SCRAM" /etc/upsstatus 2> /dev/null ; then
# Signal UPS to shut off the inverter:
/sbin/genpowerd -k
if [ ! $? = 0 ]; then
echo
echo "There was an error signaling the UPS."
echo "Perhaps you need to edit /etc/genpowerd.conf to configure"
echo "the serial line and UPS type."
# Wasting 15 seconds of precious power:
/bin/sleep 15
fi
fi
fi
# Now halt (poweroff with APM or ACPI enabled kernels) or reboot.
if [ "$shutdown_command" = "reboot" ]; then
echo "Rebooting."
/sbin/reboot
else
/sbin/poweroff
fi