summaryrefslogtreecommitdiffstats
path: root/source/a/sysvinit-scripts/scripts/rc.M
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2021-11-11 20:36:12 +0000
committer Eric Hameleers <alien@slackware.com>2021-11-12 08:59:57 +0100
commit5f74398bf9e65ea1aa61c9a843a88f98700ccab7 (patch)
treebb5df74846116525f315ca070b70133df8cbfce8 /source/a/sysvinit-scripts/scripts/rc.M
parent53b8e9dd3942dcddfe065960ad276233e3e791a0 (diff)
downloadcurrent-5f74398bf9e65ea1aa61c9a843a88f98700ccab7.tar.gz
current-5f74398bf9e65ea1aa61c9a843a88f98700ccab7.tar.xz
Thu Nov 11 20:36:12 UTC 202120211111203612
a/sdparm-1.12-x86_64-2.txz: Rebuilt. Recompiled against sg3_utils-1.47. a/sysvinit-scripts-15.0-noarch-6.txz: Rebuilt. rc.{6,S,M}: merged changes for compatibility with LXC containers. a/udisks-1.0.5-x86_64-10.txz: Rebuilt. Recompiled against sg3_utils-1.47. ap/lxc-4.0.11-x86_64-1.txz: Upgraded. Requires libseccomp-2.5.3. No more local versions of rc.{6,S,M,inet1}: the regular versions work now. l/elfutils-0.186-x86_64-1.txz: Upgraded. l/libgpod-0.8.3-x86_64-11.txz: Rebuilt. Recompiled against sg3_utils-1.47. l/libseccomp-2.5.3-x86_64-1.txz: Added. This is needed by lxc-4.0.11. Thanks to Willy Sudiarto Raharjo. l/sg3_utils-1.47-x86_64-1.txz: Upgraded. Shared library .so-version bump. n/network-scripts-15.0-noarch-17.txz: Rebuilt. Merged changes in rc.inet1 to make it compatible with LXC containers. Patched netconfig to ensure the proper permissions on rc.networkmanager when NetworkManager is not chosen. x/ibus-1.5.25-x86_64-4.txz: Rebuilt. [PATCH] client/gtk2/ibusimcontext: Fix wrong cursor location in gtk3 apps. Thanks to Lockywolf.
Diffstat (limited to 'source/a/sysvinit-scripts/scripts/rc.M')
-rw-r--r--source/a/sysvinit-scripts/scripts/rc.M43
1 files changed, 26 insertions, 17 deletions
diff --git a/source/a/sysvinit-scripts/scripts/rc.M b/source/a/sysvinit-scripts/scripts/rc.M
index 8a1a9b046..c1e04c58f 100644
--- a/source/a/sysvinit-scripts/scripts/rc.M
+++ b/source/a/sysvinit-scripts/scripts/rc.M
@@ -14,6 +14,13 @@
# Tell the viewers what's going to happen.
echo "Going multiuser..."
+# If we are in an lxc container, set $container to skip parts of the script.
+# Thanks to Matteo Bernardini <ponce@slackbuilds.org> and Chris Willing for
+# the initial work making this script lxc compatible.
+if grep -aq container=lxc /proc/1/environ 2> /dev/null ; then
+ container="lxc"
+fi
+
# Update all the shared library links:
if [ -x /sbin/ldconfig ]; then
echo "Updating shared library links: /sbin/ldconfig &"
@@ -22,17 +29,19 @@ fi
# Call the setterm init script to set screen blanking and power management
# defaults:
-if [ -x /etc/rc.d/rc.setterm ]; then
+if [ -x /etc/rc.d/rc.setterm -a -z "$container" ]; then
/etc/rc.d/rc.setterm
fi
-# Set the hostname.
-if [ -r /etc/HOSTNAME ]; then
- /bin/hostname $(cat /etc/HOSTNAME)
-else
- # fall back on this old default:
- echo "darkstar.example.net" > /etc/HOSTNAME
- /bin/hostname $(cat /etc/HOSTNAME)
+# Set the hostname:
+if [ -z "$container" ]; then
+ if [ -r /etc/HOSTNAME ]; then
+ /bin/hostname $(cat /etc/HOSTNAME)
+ else
+ # fall back on this old default:
+ echo "darkstar.example.net" > /etc/HOSTNAME
+ /bin/hostname $(cat /etc/HOSTNAME)
+ fi
fi
# Set the permissions on /var/log/dmesg according to whether the kernel
@@ -68,7 +77,7 @@ fi
# Hopefully this situation will be unified in the future, but for now
# that's how it is...
#
-if [ -x /etc/rc.d/rc.pcmcia ]; then
+if [ -x /etc/rc.d/rc.pcmcia -a -z "$container" ]; then
/etc/rc.d/rc.pcmcia start
# The cards might need a little extra time here to initialize.
sleep 5
@@ -90,19 +99,19 @@ fi
# to look for device changes and to generate persistent rules if needed.
if grep -wq sysfs /proc/mounts && grep -q devtmpfs /proc/filesystems ; then
if ! grep -wq nohotplug /proc/cmdline ; then
- if [ -x /etc/rc.d/rc.udev ]; then
+ if [ -x /etc/rc.d/rc.udev -a -z "$container" ]; then
/etc/rc.d/rc.udev start
fi
fi
fi
# Start the haveged entropy daemon:
-if [ -x /etc/rc.d/rc.haveged ]; then
+if [ -x /etc/rc.d/rc.haveged -a -z "$container" ]; then
/etc/rc.d/rc.haveged start
fi
# Start the rngd entropy daemon:
-if [ -x /etc/rc.d/rc.rngd ]; then
+if [ -x /etc/rc.d/rc.rngd -a -z "$container" ]; then
/etc/rc.d/rc.rngd start
fi
@@ -167,12 +176,12 @@ chmod 755 / 2> /dev/null
chmod 1777 /tmp /var/tmp
# Start ACPI daemon.
-if [ -x /etc/rc.d/rc.acpid ]; then
+if [ -x /etc/rc.d/rc.acpid -a -z "$container" ]; then
/etc/rc.d/rc.acpid start
fi
# Enable CPU frequency scaling:
-if [ -x /etc/rc.d/rc.cpufreq ]; then
+if [ -x /etc/rc.d/rc.cpufreq -a -z "$container" ]; then
/etc/rc.d/rc.cpufreq start
fi
@@ -258,7 +267,7 @@ fi
# Start smartd, which monitors the status of S.M.A.R.T. compatible
# hard drives and reports any problems:
-if [ -x /etc/rc.d/rc.smartd ]; then
+if [ -x /etc/rc.d/rc.smartd -a -z "$container" ]; then
/etc/rc.d/rc.smartd start
fi
@@ -269,7 +278,7 @@ fi
# /usr/doc/genpower-*/ directory.
# You'll also need to configure a similar block in /etc/rc.d/rc.6 if you want
# support for stopping the UPS's inverter after the machine halts.
-#if [ -x /sbin/genpowerd ]; then
+#if [ -x /sbin/genpowerd -a -z "$container" ]; then
# echo "Starting genpowerd daemon..."
# /sbin/genpowerd
#fi
@@ -339,7 +348,7 @@ elif [ -x /etc/rc.d/rc.postfix -a -x usr/sbin/postdrop ]; then
fi
# Load ALSA (sound) defaults:
-if [ -x /etc/rc.d/rc.alsa ]; then
+if [ -x /etc/rc.d/rc.alsa -a -z "$container" ]; then
/etc/rc.d/rc.alsa
fi