From decf19bb9dc7b70ad89f9154899e73df069f5e62 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Fri, 25 Feb 2011 16:41:25 -0500 Subject: Call sync after nfs unmount, otherwise we'll hang when the kernel syncs later. (#637500) --- rc.d/init.d/netfs | 1 + 1 file changed, 1 insertion(+) (limited to 'rc.d') diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs index 8d9854fb..3713cf45 100755 --- a/rc.d/init.d/netfs +++ b/rc.d/init.d/netfs @@ -116,6 +116,7 @@ case "$1" in $"Unmounting NFS filesystems: " \ $"Unmounting NFS filesystems (retry): " \ "-f -l" + sync fi if [ -n "$CIFSMTAB" ]; then for MNT in $CIFSMTAB; do -- cgit v1.2.1 From 681717364c786083356ebe5d92c4cc6fd73af307 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 28 Feb 2011 14:46:25 -0500 Subject: Allow for plymouth to enter non-LUKS passphrases (#621158, ) --- rc.d/init.d/functions | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'rc.d') diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 3f2cbc50..3eddf1ea 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -786,10 +786,16 @@ init_crypto() { rc=$? fi else - [ -z "$key" ] && plymouth --hide-splash - /sbin/cryptsetup $params ${key:+-d $key} create "$dst" "$src" <&1 2>/dev/null && success || failure - rc=$? - [ -z "$key" ] && plymouth --show-splash + if [ -z "$key" ]; then + mount_point="$(find_crypto_mount_point $dst)" + [ -n "$mount_point" ] || mount_point=${src##*/} + prompt=$(printf $"%s is password protected" "$mount_point") + plymouth ask-for-password --prompt "$prompt" --command="/sbin/cryptsetup $params create $dst $src" <&1 + rc=$? + else + /sbin/cryptsetup $params ${key:+-d $key} create "$dst" "$src" <&1 2>/dev/null && success || failure + rc=$? + fi fi if [ $rc -ne 0 ]; then ret=1 -- cgit v1.2.1 From 5212d0a596d67bbd2f5effdd3686c123f778078f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 21 Feb 2010 21:21:48 +0200 Subject: Drop some unnecessary command invocations. --- rc.d/init.d/functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rc.d') diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 3eddf1ea..63d1190e 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -671,7 +671,7 @@ find_crypto_mount_point() { # Because of a chicken/egg problem, init_crypto must be run twice. /var may be # encrypted but /var/lib/random-seed is needed to initialize swap. init_crypto() { - local have_random dst src key opt mode owner params makeswap skip arg opt + local have_random dst src key opt lsl owner params makeswap skip arg opt local param value rc ret mke2fs mdir prompt mount_point ret=0 @@ -686,8 +686,8 @@ init_crypto() { if test -e "$key" ; then owner=$(ls -l $key | (read a b owner rest; echo $owner)) if ! key_is_random "$key"; then - mode=$(ls -l "$key" | cut -c 5-10) - if [ "$mode" != "------" ]; then + lsl=$(ls -l "$key") + if [ "${lsl:4:6}" != "------" ]; then echo $"INSECURE MODE FOR $key" fi fi -- cgit v1.2.1 From ec2bee09f74293bf30cd06e62ae2a6845af09dda Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 28 Feb 2011 15:53:12 -0500 Subject: Add support for noauto crypt devices, to mirror systemd. --- rc.d/init.d/functions | 3 +++ 1 file changed, 3 insertions(+) (limited to 'rc.d') diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 63d1190e..5fd4742a 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -751,6 +751,9 @@ init_crypto() { skip="yes" fi ;; + noauto) + skip="yes" + ;; verify) params="$params -y" ;; -- cgit v1.2.1 From 9369bf1568b73061fe29670b4faae80c6507d56f Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 28 Feb 2011 16:31:09 -0500 Subject: Make killproc more granular when delay is passed. (#428029, ) --- rc.d/init.d/functions | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'rc.d') diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 5fd4742a..212ecee8 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -312,7 +312,7 @@ daemon() { # A function to stop a program. killproc() { - local RC killlevel= base pid pid_file= delay + local RC killlevel= base pid pid_file= delay try RC=0; delay=3 # Test syntax. @@ -355,11 +355,17 @@ killproc() { # TERM first, then KILL if not dead kill -TERM $pid >/dev/null 2>&1 usleep 100000 - if checkpid $pid && sleep 1 && - checkpid $pid && sleep $delay && - checkpid $pid ; then - kill -KILL $pid >/dev/null 2>&1 - usleep 100000 + if checkpid $pid ; then + try=0 + while [ $try -lt $delay ] ; do + checkpid $pid || break + sleep 1 + let try+=1 + done + if checkpid $pid ; then + kill -KILL $pid >/dev/null 2>&1 + usleep 100000 + fi fi fi checkpid $pid -- cgit v1.2.1 From 13f2ec05b5af5f57b6847b04185c6e710dc769b2 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 28 Feb 2011 16:34:56 -0500 Subject: Tweak waiting times slightly. (#596451) --- rc.d/init.d/functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rc.d') diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 212ecee8..da8d9794 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -354,7 +354,7 @@ killproc() { if checkpid $pid 2>&1; then # TERM first, then KILL if not dead kill -TERM $pid >/dev/null 2>&1 - usleep 100000 + usleep 50000 if checkpid $pid ; then try=0 while [ $try -lt $delay ] ; do @@ -364,7 +364,7 @@ killproc() { done if checkpid $pid ; then kill -KILL $pid >/dev/null 2>&1 - usleep 100000 + usleep 50000 fi fi fi -- cgit v1.2.1 From 3f296db591da779000a301b2b29560ee6df413f3 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 28 Feb 2011 16:56:40 -0500 Subject: Move sysctl.conf/sysctl.d handling to a function, call it where appropriate. (#593211, continued) --- rc.d/init.d/functions | 9 +++++++++ rc.d/init.d/network | 4 ++-- rc.d/rc.sysinit | 6 +----- 3 files changed, 12 insertions(+), 7 deletions(-) (limited to 'rc.d') diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index da8d9794..7377f999 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -658,6 +658,15 @@ is_false() { return 1 } +# Apply sysctl settings, including files in /etc/sysctl.d +apply_sysctl() { + 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 +} + key_is_random() { [ "$1" = "/dev/urandom" -o "$1" = "/dev/hw_random" \ -o "$1" = "/dev/random" ] diff --git a/rc.d/init.d/network b/rc.d/init.d/network index b31060b0..738a3440 100755 --- a/rc.d/init.d/network +++ b/rc.d/init.d/network @@ -61,7 +61,7 @@ case "$1" in /etc/sysconfig/network-scripts/init.ipv6-global start pre fi - sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1 + apply_sysctl # bring up loopback interface action $"Bringing up loopback interface: " ./ifup ifcfg-lo @@ -164,7 +164,7 @@ case "$1" in /etc/sysconfig/network-scripts/init.ipv6-global start post fi # Run this again to catch any interface-specific actions - sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1 + apply_sysctl touch /var/lock/subsys/network diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index f8f701af..3973c444 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -151,11 +151,7 @@ mount -n /dev/pts >/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 # Set the hostname. update_boot_stage RChostname -- cgit v1.2.1 From 8aba31240078aa1b4a7621715615743a73c9881f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 3 Feb 2011 20:45:43 +0200 Subject: Avoid some unnecessary stat calls. --- rc.d/rc.sysinit | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'rc.d') diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 3973c444..ad2c83e5 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -194,7 +194,7 @@ if ! strstr "$cmdline" nodmraid && [ -x /sbin/dmraid ]; then fi # Start any MD RAID arrays that haven't been started yet -[ -r /proc/mdstat -a -r /dev/md/md-device-map ] && /sbin/mdadm -IRs +[ -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 --sysinit @@ -204,7 +204,7 @@ if [ -f /etc/crypttab ]; then init_crypto 0 fi -if [ -f /fastboot ] || strstr "$cmdline" fastboot ; then +if strstr "$cmdline" fastboot || [ -f /fastboot ]; then fastboot=yes fi @@ -212,7 +212,7 @@ if [ -f /fsckoptions ]; then fsckoptions=$(cat /fsckoptions) fi -if [ -f /forcefsck ] || strstr "$cmdline" forcefsck ; then +if strstr "$cmdline" forcefsck || [ -f /forcefsck ]; then fsckoptions="-f $fsckoptions" elif [ -f /.autofsck ]; then [ -f /etc/sysconfig/autofsck ] && . /etc/sysconfig/autofsck @@ -632,14 +632,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 # Now that we have all of our basic modules loaded and the kernel going, -- cgit v1.2.1 From 6fa9b81fe263f25c1395a6156d939433623a849f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 1 Mar 2011 17:35:52 +0200 Subject: Fix path to sysconfig.txt in comments. --- rc.d/init.d/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rc.d') diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 7377f999..01cfed8c 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -73,7 +73,7 @@ if [ -z "${BOOTUP:-}" ]; then . /etc/sysconfig/init else # This all seem confusing? Look in /etc/sysconfig/init, - # or in /usr/doc/initscripts-*/sysconfig.txt + # or in /usr/share/doc/initscripts-*/sysconfig.txt BOOTUP=color RES_COL=60 MOVE_TO_COL="echo -en \\033[${RES_COL}G" -- cgit v1.2.1 From a9b0d6b5c655da96783851d5304c4d800d4e4553 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 7 Mar 2011 15:53:45 -0500 Subject: Don't do force/lazy umount for the first nfs umount. (#676851, ) This can cause hung tasks that aren't cleaned up or killed properly, as their dangling references won't get caught. --- rc.d/init.d/functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rc.d') diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 01cfed8c..ff6ac88c 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -124,7 +124,7 @@ __fgrep() { return 1 } -# __umount_loop awk_program fstab_file first_msg retry_msg umount_args +# __umount_loop awk_program fstab_file first_msg retry_msg retry_umount_args # awk_program should process fstab_file and return a list of fstab-encoded # paths; it doesn't have to handle comments in fstab_file. __umount_loop() { @@ -134,7 +134,7 @@ __umount_loop() { remaining=$(LC_ALL=C awk "/^#/ {next} $1" "$2" | sort -r) while [ -n "$remaining" -a "$retry" -gt 0 ]; do if [ "$retry" -eq 3 ]; then - action "$3" fstab-decode umount $5 $remaining + action "$3" fstab-decode umount '' $remaining else action "$4" fstab-decode umount $5 $remaining fi -- cgit v1.2.1 From 88592411ed0efb188a97872a69a5e417c21ffd3a Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 10 Mar 2011 15:52:25 -0500 Subject: Revert "Call sync after nfs unmount, otherwise we'll hang when the kernel syncs later. (#637500)" This reverts commit decf19bb9dc7b70ad89f9154899e73df069f5e62. This is better handled by not doing a force/lazy umount the first time. (a9b0d6b5c655da96783851d5304c4d800d4e4553) --- rc.d/init.d/netfs | 1 - 1 file changed, 1 deletion(-) (limited to 'rc.d') diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs index 3713cf45..8d9854fb 100755 --- a/rc.d/init.d/netfs +++ b/rc.d/init.d/netfs @@ -116,7 +116,6 @@ case "$1" in $"Unmounting NFS filesystems: " \ $"Unmounting NFS filesystems (retry): " \ "-f -l" - sync fi if [ -n "$CIFSMTAB" ]; then for MNT in $CIFSMTAB; do -- cgit v1.2.1 From 22c79dd133d0e0d72667c1d9c4cfd4e82c83e7a9 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 15 Mar 2011 12:37:43 -0400 Subject: Fix mishandled argument to fstab-decode. (#685137) --- rc.d/init.d/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rc.d') diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index ff6ac88c..ec4f2bbe 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -134,7 +134,7 @@ __umount_loop() { remaining=$(LC_ALL=C awk "/^#/ {next} $1" "$2" | sort -r) while [ -n "$remaining" -a "$retry" -gt 0 ]; do if [ "$retry" -eq 3 ]; then - action "$3" fstab-decode umount '' $remaining + action "$3" fstab-decode umount $remaining else action "$4" fstab-decode umount $5 $remaining fi -- cgit v1.2.1 From 5e2b364ebd6808c43f46f7853d2fe6de4edbada1 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 22 Mar 2011 14:27:11 -0400 Subject: Add a comment explaining the oft-confused -t nox,y,z mount syntax. The 'no' applies to all listed filesystem types, not just the first. Since this comes up in bugzilla once every month or two, explicitly comment it. --- rc.d/init.d/netfs | 1 + rc.d/rc.sysinit | 1 + 2 files changed, 2 insertions(+) (limited to 'rc.d') diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs index 8d9854fb..77a0a68d 100755 --- a/rc.d/init.d/netfs +++ b/rc.d/init.d/netfs @@ -98,6 +98,7 @@ case "$1" in fi } touch /var/lock/subsys/netfs + # The 'no' applies to all listed filesystem types. See mount(8). action $"Mounting other filesystems: " mount -a -t nonfs,nfs4,cifs,ncpfs,gfs ;; stop) diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index ad2c83e5..6067ea88 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -494,6 +494,7 @@ fi # Mount all other filesystems (except for NFS and /proc, which is already # mounted). Contrary to standard usage, # filesystems are NOT unmounted in single user mode. +# The 'no' applies to all listed filesystem types. See mount(8). if [ "$READONLY" != "yes" ] ; then action $"Mounting local filesystems: " mount -a -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev else -- cgit v1.2.1 From 255a2b7db036fd4b1df99028ba6298c4b5837485 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Fri, 25 Mar 2011 16:17:16 -0400 Subject: Use net_log where appropriate. --- rc.d/init.d/network | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rc.d') diff --git a/rc.d/init.d/network b/rc.d/init.d/network index 738a3440..dd4e7700 100755 --- a/rc.d/init.d/network +++ b/rc.d/init.d/network @@ -79,7 +79,7 @@ case "$1" in case "$VLAN" in yes) if [ ! -d /proc/net/vlan ] && ! modprobe 8021q >/dev/null 2>&1 ; then - echo $"No 802.1Q VLAN support available in kernel." + net_log $"No 802.1Q VLAN support available in kernel." fi ;; esac -- cgit v1.2.1 From ae1353b8528561a41fe82314f3ee010a82e6da7a Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Wed, 30 Mar 2011 12:31:14 -0400 Subject: Don't print errors if mdadm isn't installed. (#692187) --- rc.d/init.d/netfs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rc.d') diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs index 77a0a68d..6bb149f6 100755 --- a/rc.d/init.d/netfs +++ b/rc.d/init.d/netfs @@ -43,8 +43,8 @@ case "$1" in [ -n "$NCPFSTAB" ] && action $"Mounting NCP filesystems: " mount -a -t ncpfs [ -n "$NETDEVFSTAB" ] && { - if [ -f /etc/mdadm.conf ]; then - mdadm -A -s + if [ -f /etc/mdadm.conf ] && [ -x /sbin/mdadm ]; then + /sbin/mdadm -A -s fi if [ -f /etc/multipath.conf ] && [ -x /sbin/multipath ]; then modprobe dm-multipath >/dev/null 2>&1 -- cgit v1.2.1 From 3c38f904f831f02d5f5c28f431ca86d9877697f1 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 18 Apr 2011 14:16:08 -0400 Subject: Support overriding hostname via /etc/hostname. --- rc.d/rc.sysinit | 3 +++ 1 file changed, 3 insertions(+) (limited to 'rc.d') diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 6067ea88..561e99e8 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -12,6 +12,9 @@ set -m if [ -f /etc/sysconfig/network ]; then . /etc/sysconfig/network fi +if [ -r /etc/hostname ]; then + HOSTNAME=$(cat /etc/hostname) +fi if [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" ]; then HOSTNAME=localhost fi -- cgit v1.2.1 From c145e815bcfad7f35fb1b53cdea2d0f66c1fd4e2 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 25 Apr 2011 14:40:08 -0400 Subject: Fix logic error (#698520, ) --- rc.d/rc.sysinit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rc.d') diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 561e99e8..09f93b32 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -330,7 +330,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 -- cgit v1.2.1 From a8295afa615410bfef2df178ab8764cdc25bf2e0 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 9 May 2011 12:36:45 -0400 Subject: don't match filesystem types in hostnames (#703203, ) --- rc.d/init.d/halt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'rc.d') diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt index cb33cbed..267a7c83 100755 --- a/rc.d/init.d/halt +++ b/rc.d/init.d/halt @@ -140,7 +140,8 @@ __umount_loop '$3 ~ /^rpc_pipefs$/ || $3 ~ /^rpc_svc_gss_pipefs$/ {print $2}' \ LANG=C __umount_loop '$2 ~ /^\/$|^\/proc|^\/cgroup|^\/sys\/fs\/cgroup|^\/dev/{next} $3 == "tmpfs" || $3 == "proc" {print $2 ; next} - /(loopfs|autofs|nfs|cifs|smbfs|ncpfs|sysfs|^none|^\/dev\/ram|^\/dev\/root$)/ {next} + $3 ~ /(loopfs|autofs|nfs|cifs|smbfs|ncpfs|sysfs)/ {next} + /(^none|^\/dev\/ram|^\/dev\/root$)/ {next} {print $2}' /proc/mounts \ $"Unmounting file systems: " \ $"Unmounting file systems (retry): " \ -- cgit v1.2.1 From 81b50ecb6be1df83b45c6ed868e855c6d11bf135 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 10 May 2011 15:02:47 -0400 Subject: fuser -k defaults to -9; set the initial pass to kill -15. (#703457) --- rc.d/init.d/functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rc.d') diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index ec4f2bbe..8a3177a1 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -128,7 +128,7 @@ __fgrep() { # awk_program should process fstab_file and return a list of fstab-encoded # paths; it doesn't have to handle comments in fstab_file. __umount_loop() { - local remaining sig= + local remaining sig=-15 local retry=3 count remaining=$(LC_ALL=C awk "/^#/ {next} $1" "$2" | sort -r) @@ -156,7 +156,7 @@ __umount_loop() { # Similar to __umount loop above, specialized for loopback devices __umount_loopback_loop() { - local remaining devremaining sig= + local remaining devremaining sig=-15 local retry=3 remaining=$(awk '$1 ~ /^\/dev\/loop/ && $2 != "/" {print $2}' /proc/mounts) -- cgit v1.2.1 From 7bbed9542c60bdece7d86460dff16ce0f4a1ae26 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 10 May 2011 15:11:07 -0400 Subject: Use LC_ALL=C when calling sed. (https://bugs.mageia.org/show_bug.cgi?id=1216, via ) --- rc.d/init.d/network | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rc.d') diff --git a/rc.d/init.d/network b/rc.d/init.d/network index dd4e7700..ac30b8f3 100755 --- a/rc.d/init.d/network +++ b/rc.d/init.d/network @@ -44,11 +44,11 @@ cd /etc/sysconfig/network-scripts # find all the interfaces besides loopback. # ignore aliases, alternative configurations, and editor backup files interfaces=$(ls ifcfg* | \ - LANG=C sed -e "$__sed_discard_ignored_files" \ + LC_ALL=C sed -e "$__sed_discard_ignored_files" \ -e '/\(ifcfg-lo$\|:\|ifcfg-.*-range\)/d' \ -e '/ifcfg-[A-Za-z0-9#\._-]\+$/ { s/^ifcfg-//g;s/[0-9]/ &/}' | \ - LANG=C sort -k 1,1 -k 2n | \ - LANG=C sed 's/ //') + LC_ALL=C sort -k 1,1 -k 2n | \ + LC_ALL=C sed 's/ //') rc=0 # See how we were called. -- cgit v1.2.1 From caca80528ead03919e6157ccd2bdffff37e2dbad Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 10 May 2011 15:13:27 -0400 Subject: Tweak wording, as other scripts with S99 priority may actually run later. (#703148) --- rc.d/rc.local | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rc.d') diff --git a/rc.d/rc.local b/rc.d/rc.local index 0036e6c5..c6a8faf1 100755 --- a/rc.d/rc.local +++ b/rc.d/rc.local @@ -1,6 +1,6 @@ #!/bin/sh # -# This script will be executed *after* all the other init scripts. +# This script will be executed at the end of the boot process. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. -- cgit v1.2.1 From 96543426898ebd6d7158a88ce4c42184a7d01169 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 12 May 2011 14:00:46 -0400 Subject: VLAN, etc. interfaces can be slaves; check for being a slave first. (#703475) --- rc.d/init.d/network | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rc.d') diff --git a/rc.d/init.d/network b/rc.d/init.d/network index ac30b8f3..b3dbe7a6 100755 --- a/rc.d/init.d/network +++ b/rc.d/init.d/network @@ -98,6 +98,10 @@ case "$1" in if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi + if [ "$SLAVE" = "yes" ]; then + continue + fi + if [ "${DEVICE##cipcb}" != "$DEVICE" ] ; then vpninterfaces="$vpninterfaces $i" continue @@ -121,10 +125,6 @@ case "$1" in continue fi - if [ "$SLAVE" = "yes" ]; then - continue - fi - if LANG=C grep -EL "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ifcfg-$i > /dev/null ; then # this loads the module, to preserve ordering is_available $i -- cgit v1.2.1 From 56ac215dd147c559558009ca899dc33d9932dce2 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 2 Jun 2011 11:23:14 -0400 Subject: Clean up some noise if stderr isn't available. --- rc.d/init.d/functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rc.d') diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 8a3177a1..1b0b4843 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -55,9 +55,9 @@ systemctl_redirect () { if [ -z "${CONSOLETYPE:-}" ]; then if [ -r "/dev/stderr" ]; then - CONSOLETYPE="$(/sbin/consoletype < /dev/stderr)" + CONSOLETYPE="$(/sbin/consoletype < /dev/stderr 2>/dev/null)" else - CONSOLETYPE="$(/sbin/consoletype)" + CONSOLETYPE="$(/sbin/consoletype 2>/dev/null)" fi fi -- cgit v1.2.1 From 95521ae815ae158ddc2d0ed772e189315cb27bb8 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 20 Jun 2011 15:42:19 -0400 Subject: Start udev by hand. (#714531) --- rc.d/rc.sysinit | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'rc.d') diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 09f93b32..e0ce09c8 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -137,7 +137,10 @@ fi nashpid=$(pidof nash 2>/dev/null) [ -n "$nashpid" ] && kill $nashpid >/dev/null 2>&1 unset nashpid -/sbin/start_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 -- cgit v1.2.1 From b086b1eb36c0f1ea9c6a41479e64cdeed5720836 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 21 Jun 2011 15:20:21 -0400 Subject: Add back a message for udev start. (#714531, continued) --- rc.d/rc.sysinit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rc.d') diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index e0ce09c8..c572384a 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -137,7 +137,7 @@ fi nashpid=$(pidof nash 2>/dev/null) [ -n "$nashpid" ] && kill $nashpid >/dev/null 2>&1 unset nashpid -/sbin/udevd --daemon +action $"Starting udev: " /sbin/udevd --daemon /sbin/udevadm trigger --type=subsystems --action=add /sbin/udevadm trigger --type=devices --action=add /sbin/udevadm settle -- cgit v1.2.1 From 2d3dfa0c5c2d0e95943df8b5ec655787264012d7 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 1 Aug 2011 16:12:07 -0400 Subject: Don't mount gfs2 in netfs (#689593) --- rc.d/init.d/netfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rc.d') diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs index 6bb149f6..ae708eab 100755 --- a/rc.d/init.d/netfs +++ b/rc.d/init.d/netfs @@ -99,7 +99,7 @@ case "$1" in } touch /var/lock/subsys/netfs # The 'no' applies to all listed filesystem types. See mount(8). - action $"Mounting other filesystems: " mount -a -t nonfs,nfs4,cifs,ncpfs,gfs + action $"Mounting other filesystems: " mount -a -t nonfs,nfs4,cifs,ncpfs,gfs2 ;; stop) # Unmount loopback stuff first -- cgit v1.2.1 From 19ea300575c00132cf576ae0f8ef99f0c78f20d1 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 15 Aug 2011 16:23:38 -0400 Subject: plymouth lives in /bin. (#702814) --- rc.d/init.d/functions | 10 +++++----- rc.d/init.d/netfs | 4 ++-- rc.d/rc.sysinit | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'rc.d') diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 1b0b4843..79545b51 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -546,8 +546,8 @@ echo_warning() { # Inform the graphical boot of our current state update_boot_stage() { - if [ -x /usr/bin/plymouth ]; then - /usr/bin/plymouth --update="$1" + if [ -x /bin/plymouth ]; then + /bin/plymouth --update="$1" fi return 0 } @@ -562,7 +562,7 @@ success() { failure() { local rc=$? [ "$BOOTUP" != "verbose" -a -z "${LSB:-}" ] && echo_failure - [ -x /usr/bin/plymouth ] && /usr/bin/plymouth --details + [ -x /bin/plymouth ] && /bin/plymouth --details return $rc } @@ -601,7 +601,7 @@ strstr() { # Confirm whether we really want to run this service confirm() { - [ -x /usr/bin/plymouth ] && /usr/bin/plymouth --hide-splash + [ -x /bin/plymouth ] && /bin/plymouth --hide-splash while : ; do echo -n $"Start service $1 (Y)es/(N)o/(C)ontinue? [Y] " read answer @@ -609,7 +609,7 @@ confirm() { return 0 elif strstr $"cC" "$answer" ; then rm -f /var/run/confirm - [ -x /usr/bin/plymouth ] && /usr/bin/plymouth --show-splash + [ -x /bin/plymouth ] && /bin/plymouth --show-splash return 2 elif strstr $"nN" "$answer" ; then return 1 diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs index ae708eab..4358572d 100755 --- a/rc.d/init.d/netfs +++ b/rc.d/init.d/netfs @@ -78,8 +78,8 @@ case "$1" in fi if [ "$rc" -gt 1 ]; then - if [ -x /usr/bin/plymouth ] && /usr/bin/plymouth --ping ; then - /usr/bin/plymouth --hide-splash + if [ -x /bin/plymouth ] && /bin/plymouth --ping ; then + /bin/plymouth --hide-splash fi failure "$STRING" tty >/dev/null 2>&1 || exit 1 diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index c572384a..fd907f4a 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -32,7 +32,7 @@ fi . /etc/init.d/functions PLYMOUTH= -[ -x /usr/bin/plymouth ] && PLYMOUTH=yes +[ -x /bin/plymouth ] && PLYMOUTH=yes # Check SELinux status SELINUX_STATE= @@ -545,8 +545,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 @@ -660,7 +660,7 @@ if strstr "$cmdline" confirm ; then fi # 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 -- cgit v1.2.1 From 588b435f07ef70684d7979b0472b8a0aabe44d71 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 25 Aug 2011 14:33:48 -0400 Subject: Call multipath and kpartx with -u. (#733437) --- rc.d/init.d/netfs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rc.d') diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs index 4358572d..3633284b 100755 --- a/rc.d/init.d/netfs +++ b/rc.d/init.d/netfs @@ -48,9 +48,9 @@ case "$1" in fi if [ -f /etc/multipath.conf ] && [ -x /sbin/multipath ]; then modprobe dm-multipath >/dev/null 2>&1 - /sbin/multipath -v 0 + /sbin/multipath -u -v 0 if [ -x /sbin/kpartx ]; then - /sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -a -p p" + /sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -u -a -p p" fi fi if [ -x /sbin/lvm ]; then -- cgit v1.2.1 From 8e35de888bde8b123bf19c23cb4e8974cb75475e Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 30 Aug 2011 15:17:14 -0400 Subject: selinuxfs moved, adjust code. (#733759) --- rc.d/rc.sysinit | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'rc.d') diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index fd907f4a..5248cfb1 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -36,9 +36,9 @@ PLYMOUTH= # 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 @@ -53,7 +53,7 @@ disable_selinux() { echo $"*** Warning -- SELinux is active" echo $"*** Disabling security enforcement for system recovery." echo $"*** Run 'setenforce 1' to reenable." - echo "0" > "/selinux/enforce" + echo "0" > "/sys/fs/selinux/enforce" } relabel_selinux() { @@ -61,7 +61,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 @@ -231,9 +231,9 @@ elif [ -f /.autofsck ]; then echo $"*** Warning -- the system did not shut down cleanly. " echo $"*** Dropping you to a shell; the system will continue" echo $"*** when you leave the shell." - [ -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" -- cgit v1.2.1 From 09bfb5033230e6846414bc6002aa12ce09c23687 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 19 Sep 2011 17:45:17 -0400 Subject: Only bother with consoletype if we're actually connected to something that's console-ish. (#657869) If we're connected to a socket, or a pipe, or a file, or anything else - assume dumb mode. --- rc.d/init.d/functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rc.d') diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 79545b51..e313e35b 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -54,10 +54,10 @@ systemctl_redirect () { [ -z "${COLUMNS:-}" ] && COLUMNS=80 if [ -z "${CONSOLETYPE:-}" ]; then - if [ -r "/dev/stderr" ]; then + if [ -c "/dev/stderr" ]; then CONSOLETYPE="$(/sbin/consoletype < /dev/stderr 2>/dev/null)" else - CONSOLETYPE="$(/sbin/consoletype 2>/dev/null)" + CONSOLETYPE="serial" fi fi -- cgit v1.2.1 From a28a3f03b42377f50ab46fd669bc93b287c20b11 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Fri, 30 Sep 2011 10:52:05 -0400 Subject: Be less picky about ifcfg file names. (#742276) --- rc.d/init.d/network | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rc.d') diff --git a/rc.d/init.d/network b/rc.d/init.d/network index b3dbe7a6..c6b86c37 100755 --- a/rc.d/init.d/network +++ b/rc.d/init.d/network @@ -43,10 +43,10 @@ cd /etc/sysconfig/network-scripts # find all the interfaces besides loopback. # ignore aliases, alternative configurations, and editor backup files -interfaces=$(ls ifcfg* | \ +interfaces=$(ls ifcfg-* | \ LC_ALL=C sed -e "$__sed_discard_ignored_files" \ -e '/\(ifcfg-lo$\|:\|ifcfg-.*-range\)/d' \ - -e '/ifcfg-[A-Za-z0-9#\._-]\+$/ { s/^ifcfg-//g;s/[0-9]/ &/}' | \ + -e '{ s/^ifcfg-//g;s/[0-9]/ &/}' | \ LC_ALL=C sort -k 1,1 -k 2n | \ LC_ALL=C sed 's/ //') rc=0 -- cgit v1.2.1 From 07b90103fcee7e6ec096f941fd4688923b8cf768 Mon Sep 17 00:00:00 2001 From: Doug Knight Date: Fri, 7 Oct 2011 11:59:17 -0800 Subject: Only use the first ARP response in netconsole (#744309) --- rc.d/init.d/netconsole | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rc.d') diff --git a/rc.d/init.d/netconsole b/rc.d/init.d/netconsole index 7f91a6c6..42733de0 100644 --- a/rc.d/init.d/netconsole +++ b/rc.d/init.d/netconsole @@ -54,7 +54,7 @@ print_address_info () target=$host fi if [ -z "$SYSLOGMACADDR" ]; then - arp=$(LANG=C /sbin/arping -c 1 -I $DEV $target 2>/dev/null | awk '/ reply from .*[.*]/ { print gensub(".* reply from .* \\[(.*)\\].*","\\1","G") }') + arp=$(LANG=C /sbin/arping -c 1 -I $DEV $target 2>/dev/null | awk '/ reply from .*[.*]/ { print gensub(".* reply from .* \\[(.*)\\].*","\\1","G"); exit }') [ -n "$arp" ] && echo "SYSLOGMACADDR=$arp" fi } -- cgit v1.2.1 From d088bd27ef9fac2695c9769b4fbb230e32d93b31 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 25 Oct 2011 12:47:26 -0400 Subject: If locale.conf exists, use it. (#706756, in part) systemd's algorithm on startup is: - if /etc/locale.conf is parseable, use that - otherwise, use /etc/sysconfig/i18n Given that we have a heirarchy of system -> user settings here, simply go: ~/.i18n > /etc/locale.conf > /etc/sysconfig/i18n Add some documentation as well. --- rc.d/init.d/functions | 2 +- rc.d/rc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'rc.d') diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index e313e35b..1437b252 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -61,7 +61,7 @@ if [ -z "${CONSOLETYPE:-}" ]; then fi fi -if [ -z "${NOLOCALE:-}" ] && [ -z "${LANGSH_SOURCED:-}" ] && [ -f /etc/sysconfig/i18n ] ; then +if [ -z "${NOLOCALE:-}" ] && [ -z "${LANGSH_SOURCED:-}" ] && [ -f /etc/sysconfig/i18n -o -f /etc/locale.conf ] ; then . /etc/profile.d/lang.sh 2>/dev/null # avoid propagating LANGSH_SOURCED any further unset LANGSH_SOURCED diff --git a/rc.d/rc b/rc.d/rc index 678bb5e5..d7b68b69 100755 --- a/rc.d/rc +++ b/rc.d/rc @@ -51,7 +51,7 @@ fi # Set language, vc settings once to avoid doing it for every init script # through functions -if [ -z "${NOLOCALE:-}" ] && [ -f /etc/sysconfig/i18n ] ; then +if [ -z "${NOLOCALE:-}" ] && [ -f /etc/sysconfig/i18n -o -f /etc/locale.conf ] ; then . /etc/profile.d/lang.sh 2>/dev/null export LANGSH_SOURCED=1 fi -- cgit v1.2.1