aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/rc.sysinit
diff options
context:
space:
mode:
Diffstat (limited to 'rc.d/rc.sysinit')
-rwxr-xr-xrc.d/rc.sysinit58
1 files changed, 33 insertions, 25 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index 18368b08..6b1baf0f 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -20,6 +20,10 @@ if [ -f /etc/sysconfig/system ]; then
. /etc/sysconfig/system
fi
+if [ -r /etc/hostname ]; then
+ HOSTNAME=$(cat /etc/hostname)
+fi
+
if [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" ]; then
HOSTNAME=localhost
fi
@@ -161,11 +165,14 @@ if [ "x$SPEEDBOOT" = "xyes" ]; then
UDEV_PID=$!
fi
+PLYMOUTH=
+[ -x /bin/plymouth ] && PLYMOUTH=yes
+
# Check SELinux status
SELINUX_STATE=
-if [ -e "/selinux/enforce" ] && [ "$(cat /proc/self/attr/current)" != "kernel" ]; then
- if [ -r "/selinux/enforce" ] ; then
- SELINUX_STATE=$(cat "/selinux/enforce")
+if [ -e "/sys/fs/selinux/enforce" ] && [ "$(cat /proc/self/attr/current)" != "kernel" ]; then
+ if [ -r "/sys/fs/selinux/enforce" ] ; then
+ SELINUX_STATE=$(cat "/sys/fs/selinux/enforce")
else
# assume enforcing if you can't read it
SELINUX_STATE=1
@@ -180,7 +187,7 @@ disable_selinux() {
gprintf "*** Warning -- SELinux is active\n"
gprintf "*** Disabling security enforcement for system recovery.\n"
gprintf "*** Run 'setenforce 1' to reenable.\n"
- echo "0" > "/selinux/enforce"
+ echo "0" > "/sys/fs/selinux/enforce"
}
relabel_selinux() {
@@ -188,7 +195,7 @@ relabel_selinux() {
# wrong context, so a reboot will be required after relabel
AUTORELABEL=
. /etc/selinux/config
- echo "0" > /selinux/enforce
+ echo "0" > /sys/fs/selinux/enforce
[ -n "$PLYMOUTH" ] && plymouth --hide-splash
if [ "$AUTORELABEL" = "0" ]; then
@@ -271,9 +278,11 @@ fi
nashpid=$(pidof nash 2>/dev/null)
[ -n "$nashpid" ] && kill $nashpid >/dev/null 2>&1
unset nashpid
-if [ "x$SPEEDBOOT" != "xyes" ]; then
- /sbin/start_udev
-fi #SPEEDBOOT
+
+action $"Starting udev: " /sbin/udevd --daemon
+/sbin/udevadm trigger --type=subsystems --action=add
+/sbin/udevadm trigger --type=devices --action=add
+/sbin/udevadm settle
# Load other user-defined modules
for file in /etc/sysconfig/modules/*.modules ; do
@@ -297,11 +306,7 @@ mount -n -t tmpfs none /dev/shm >/dev/null 2>&1
# Configure kernel parameters
update_boot_stage RCkernelparam
-sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1
-for file in /etc/sysctl.d/* ; do
- is_ignored_file "$file" && continue
- test -f "$file" && sysctl -e -p "$file" >/dev/null 2>&1
-done
+apply_sysctl
if [ "x$SPEEDBOOT" != "xyes" ]; then
@@ -381,8 +386,12 @@ if ! strstr "$cmdline" nodmraid && [ -x /sbin/dmraid ]; then
done
fi
fi
+fi
fi #SPEEDBOOT
+# Start any MD RAID arrays that haven't been started yet
+[ -r /proc/mdstat ] && [ -r /dev/md/md-device-map ] && /sbin/mdadm -IRs
+
if [ -x /sbin/lvm ]; then
action "Setting up Logical Volume Management:" /sbin/lvm vgchange -a y --ignorelockingfailure
fi
@@ -393,7 +402,7 @@ if [ -f /etc/crypttab ]; then
fi
fi #SPEEDBOOT
-if [ -f /fastboot ] || strstr "$cmdline" fastboot ; then
+if strstr "$cmdline" fastboot || [ -f /fastboot ]; then
fastboot=yes
fi
@@ -404,7 +413,7 @@ fi
# (blino) always source autofsck settings, for AUTOFSCK_CRYPTO_TIMEOUT (#16029)
[ -f /etc/sysconfig/autofsck ] && . /etc/sysconfig/autofsck
-if [ -f /forcefsck ] || strstr "$cmdline" forcefsck ; then
+if strstr "$cmdline" forcefsck || [ -f /forcefsck ]; then
fsckoptions="-f $fsckoptions"
elif [ -f /.autofsck ]; then
if [ "$AUTOFSCK_DEF_CHECK" = "yes" ]; then
@@ -417,9 +426,9 @@ elif [ -f /.autofsck ]; then
gprintf "*** Warning -- the system did not shut down cleanly. \n"
gprintf "*** Dropping you to a shell; the system will continue\n"
gprintf "*** when you leave the shell.\n"
- [ -n "$SELINUX_STATE" ] && echo "0" > /selinux/enforce
+ [ -n "$SELINUX_STATE" ] && echo "0" > /sys/fs/selinux/enforce
sulogin
- [ -n "$SELINUX_STATE" ] && echo "1" > /selinux/enforce
+ [ -n "$SELINUX_STATE" ] && echo "1" > /sys/fs/selinux/enforce
[ -n "$PLYMOUTH" ] && plymouth --show-splash
fi
fsckoptions="$AUTOFSCK_OPT $fsckoptions"
@@ -519,7 +528,7 @@ if [ "$READONLY" = "yes" -o "$TEMPORARY_STATE" = "yes" ]; then
ipaddr=$(ip addr show to 0.0.0.0/0 scope global | awk '/[[:space:]]inet / { print gensub("/.*","","g",$2) }')
for ip in $ipaddr ; do
HOSTNAME=
- eval $(ipcalc -h $ipaddr 2>/dev/null)
+ eval $(ipcalc -h $ip 2>/dev/null)
[ -n "$HOSTNAME" ] && { hostname ${HOSTNAME} ; break; }
done
fi
@@ -747,6 +756,7 @@ fi
# export locales (needed by mount.ntfs-3g)
export LC_ALL
export LANG
+# The 'no' applies to all listed filesystem types. See mount(8).
if [ "$READONLY" != "yes" ] ; then
action "Mounting local filesystems: " mount -a -t nodevpts,nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev,noloop,noencrypted
else
@@ -845,8 +855,8 @@ fi
# Configure machine if necessary.
if [ -f /.unconfigured ]; then
- if [ -x /usr/bin/plymouth ]; then
- /usr/bin/plymouth quit
+ if [ -x /bin/plymouth ]; then
+ /bin/plymouth quit
fi
if [ -x /usr/bin/system-config-keyboard ]; then
@@ -951,14 +961,12 @@ fi
/bin/mount -t binfmt_misc none /proc/sys/fs/binfmt_misc > /dev/null 2>&1
# Boot time profiles. Yes, this should be somewhere else.
-if [ -x /usr/sbin/system-config-network-cmd ]; then
- if strstr "$cmdline" netprofile= ; then
+if strstr "$cmdline" netprofile= && [ -x /usr/sbin/system-config-network-cmd ]; then
for arg in $cmdline ; do
if [ "${arg##netprofile=}" != "${arg}" ]; then
/usr/sbin/system-config-network-cmd --profile ${arg##netprofile=}
fi
done
- fi
fi
(
@@ -1172,8 +1180,8 @@ for i in XF86Config XF86Config-4; do
done
# Let rhgb know that we're leaving rc.sysinit
-if [ -x /usr/bin/plymouth ]; then
- /usr/bin/plymouth --sysinit
+if [ -x /bin/plymouth ]; then
+ /bin/plymouth --sysinit
fi
# remove this file at the very end, for speedboot