diff options
Diffstat (limited to 'init.d')
-rwxr-xr-x | init.d/checkfs | 14 | ||||
-rwxr-xr-x | init.d/checkroot | 22 | ||||
-rwxr-xr-x | init.d/halt.sh | 26 | ||||
-rwxr-xr-x | init.d/local | 4 | ||||
-rwxr-xr-x | init.d/localmount | 2 | ||||
-rwxr-xr-x | init.d/netmount | 6 | ||||
-rwxr-xr-x | init.d/rmnologin | 2 | ||||
-rwxr-xr-x | init.d/urandom | 4 |
8 files changed, 40 insertions, 40 deletions
diff --git a/init.d/checkfs b/init.d/checkfs index c5b8728c..4174b9b4 100755 --- a/init.d/checkfs +++ b/init.d/checkfs @@ -37,12 +37,12 @@ do_checkfs() { ebegin "Checking all filesystems" - if [ -e /forcefsck ] || get_bootparam "forcefsck" ; then + if [ -e /forcefsck ] || get_bootparam "forcefsck"; then ewarn "A full fsck has been forced" mode="-f -n" fi - if [ "${RC_UNAME}" = "Linux" ] ; then + if [ "${RC_UNAME}" = "Linux" ]; then opts="-A -C0 -R -T" else parts="$(fstabinfo --passno ">1")" @@ -52,14 +52,14 @@ do_checkfs() { fsck ${opts} ${mode} ${parts} retval=$? - if [ ${retval} -eq 0 ] ; then + if [ ${retval} -eq 0 ]; then eend 0 - elif [ ${retval} -eq 1 ] ; then + elif [ ${retval} -eq 1 ]; then ewend 1 "Filesystem errors corrected." retval=0 - elif [ ${retval} -eq 2 ] ; then + elif [ ${retval} -eq 2 ]; then ewend 1 "System should be rebooted" - elif [ ${retval} -eq 8 ] ; then + elif [ ${retval} -eq 8 ]; then ewend 1 "Operational error, continuing" retval=0 else @@ -70,7 +70,7 @@ do_checkfs() { eend ${retval} fi - if [ ${retval} -gt 3 ] ; then + if [ ${retval} -gt 3 ]; then eend 2 "Fsck could not correct all errors, manual repair needed" exec rc-abort || exit 1 fi diff --git a/init.d/checkroot b/init.d/checkroot index fb313b07..1397374a 100755 --- a/init.d/checkroot +++ b/init.d/checkroot @@ -29,7 +29,7 @@ and optionally repair them." do_mtab() { # Don't create mtab if /etc is readonly - if ! printf "" 2>/dev/null >/etc/mtab ; then + if ! printf "" 2>/dev/null >/etc/mtab; then ewarn "Skipping /etc/mtab initialization (ro root?)" return 0 fi @@ -59,7 +59,7 @@ do_fsck() { esac # Don't bother doing a fsck on these - if [ -n "${CDBOOT}" ] || is_net_fs / || is_union_fs / ; then + if [ -n "${CDBOOT}" ] || is_net_fs / || is_union_fs /; then return 0 fi @@ -71,7 +71,7 @@ do_fsck() { root=$(fstabinfo --blockdevice /) [ ! -e "${root}" -a -e /dev/root ] && root=/dev/root - if [ -e /forcefsck ] || get_bootparam "forcefsck" ; then + if [ -e /forcefsck ] || get_bootparam "forcefsck"; then ebegin "Checking root filesystem (full fsck forced)" fsck ${opts} -f -n "${root}" # /forcefsck isn't deleted because checkfs needs it. @@ -80,7 +80,7 @@ do_fsck() { else # Obey the fs_passno setting for / (see fstab(5)) local pass=$(fstabinfo --passno /) - if [ ${pass:-0} != "0" ] ; then + if [ ${pass:-0} != "0" ]; then ebegin "Checking root filesystem" fsck ${opts} -p "${root}" retval=$? @@ -90,15 +90,15 @@ do_fsck() { fi fi - if [ ${retval} -eq 0 ] ; then + if [ ${retval} -eq 0 ]; then eend 0 - elif [ ${retval} -eq 1 ] ; then + elif [ ${retval} -eq 1 ]; then ewend 1 "Filesystem repaired" retval=0 - elif [ ${retval} -eq 8 ] ; then + elif [ ${retval} -eq 8 ]; then ewend 1 $"Operational error, continuing" retval=0 - elif [ ${retval} -eq 2 -o ${retval} -eq 3 ] ; then + elif [ ${retval} -eq 2 -o ${retval} -eq 3 ]; then ewend 1 "Filesystem repaired, but reboot needed!" if ! yesno ${rc_force_auto:-${RC_FORCE_AUTO}}; then printf "\a"; sleep 1; printf "\a"; sleep 1 @@ -117,9 +117,9 @@ do_fsck() { eend 2 "Filesystem couldn't be fixed :(" exec rc-abort || exit 1 fi - if [ ${retval} != "0" ] ; then + if [ ${retval} != "0" ]; then einfo "Unmounting filesystems" - if [ "${RC_UNAME}" = "Linux" ] ; then + if [ "${RC_UNAME}" = "Linux" ]; then mount -a -o remount,ro / else mount -u -o ro / @@ -135,7 +135,7 @@ start() { if ! root_rw; then ebegin "Remounting root filesystem read/write" - if [ "${RC_UNAME}" = "Linux" ] ; then + if [ "${RC_UNAME}" = "Linux" ]; then mount -n -o remount,rw / else mount -u -o rw / diff --git a/init.d/halt.sh b/init.d/halt.sh index c3f76f3b..2e4dabee 100755 --- a/init.d/halt.sh +++ b/init.d/halt.sh @@ -29,7 +29,7 @@ [ -r /etc/rc.conf ] && . /etc/rc.conf # Support LiveCD foo -if [ -r /sbin/livecd-functions.sh ] ; then +if [ -r /sbin/livecd-functions.sh ]; then . /sbin/livecd-functions.sh livecd_read_commandline fi @@ -38,7 +38,7 @@ stop_addon devfs stop_addon udev # Really kill things off before unmounting -if [ -x /sbin/killall5 ] ; then +if [ -x /sbin/killall5 ]; then killall5 -15 killall5 -9 fi @@ -50,7 +50,7 @@ sync; sync # 1) we don't need (and by default can't) umount anything (VServer) or # 2) the host utils take care of all umounting stuff (OpenVZ) if [ "${RC_SYS}" = "VPS" ]; then - if [ -e /etc/init.d/"$1".sh ] ; then + if [ -e /etc/init.d/"$1".sh ]; then . /etc/init.d/"$1".sh else exit 0 @@ -60,11 +60,11 @@ fi # If $svcdir is still mounted, preserve it if we can mnt=$(mountinfo --node "${RC_SVCDIR}") -if [ -n "${mnt}" -a -w "${RC_LIBDIR}" ] ; then +if [ -n "${mnt}" -a -w "${RC_LIBDIR}" ]; then f_opts="-m -c" [ "${RC_UNAME}" = "Linux" ] && f_opts="-c" - if [ -n "$(fuser ${f_opts} "${svcdir}" 2>/dev/null)" ] ; then - fuser -k ${f_opts} "${svcdir}" 1>/dev/null 2>/dev/null + if [ -n "$(fuser ${f_opts} "${svcdir}" 2>/dev/null)" ]; then + fuser -k ${f_opts} "${svcdir}" >/dev/null 2>&1 sleep 2 fi cp -p "${RC_SVCDIR}"/deptree "${RC_SVCDIR}"/depconfig \ @@ -83,20 +83,20 @@ if [ -n "${mnt}" -a -w "${RC_LIBDIR}" ] ; then "${RC_LIBDIR}"/rc.log # Release the memory disk if we used it case "${mnt}" in - "/dev/md"[0-9]*) mdconfig -d -u "${mnt#/dev/md*}" ;; + "/dev/md"[0-9]*) mdconfig -d -u "${mnt#/dev/md*}";; esac fi unmounted=0 # Remount the remaining filesystems read-only # Most BSD's don't need this as the kernel handles it nicely -if [ "${RC_UNAME}" = "Linux" ] ; then +if [ "${RC_UNAME}" = "Linux" ]; then ebegin "Remounting remaining filesystems read-only" # We need the do_unmount function . "${RC_LIBDIR}"/sh/rc-mount.sh eindent fs= - for x in ${net_fs_list} ; do + for x in ${net_fs_list}; do fs="${fs}${fs:+|}${x}" done [ -n "${fs}" ] && fs="^(${fs})$" @@ -109,14 +109,14 @@ if [ "${RC_UNAME}" = "Linux" ] ; then fi # This UPS code should be moved to out of here and to an addon -if [ -f /etc/killpower ] ; then +if [ -f /etc/killpower ]; then UPS_CTL=/sbin/upsdrvctl UPS_POWERDOWN="${UPS_CTL} shutdown" -elif [ -f /etc/apcupsd/powerfail ] ; then +elif [ -f /etc/apcupsd/powerfail ]; then UPS_CTL=/etc/apcupsd/apccontrol UPS_POWERDOWN="${UPS_CTL} killpower" fi -if [ -x "${UPS_CTL}" ] ; then +if [ -x "${UPS_CTL}" ]; then ewarn "Signalling ups driver(s) to kill the load!" ${UPS_POWERDOWN} ewarn "Halt system and wait for the UPS to kill our power" @@ -124,7 +124,7 @@ if [ -x "${UPS_CTL}" ] ; then sleep 60 fi -if [ ${unmounted} -ne 0 ] ; then +if [ ${unmounted} -ne 0 ]; then [ -x /sbin/sulogin ] && sulogin -t 10 /dev/console exit 1 fi diff --git a/init.d/local b/init.d/local index 55fecd55..461b4aff 100755 --- a/init.d/local +++ b/init.d/local @@ -36,7 +36,7 @@ start() { # Add any misc programs that should be started # to /etc/conf.d/local.start - if [ -e /etc/conf.d/local.start ] ; then + if [ -e /etc/conf.d/local.start ]; then . /etc/conf.d/local.start fi @@ -48,7 +48,7 @@ stop() { # Add any misc programs that should be stopped # to /etc/conf.d/local.stop - if [ -e /etc/conf.d/local.stop ] ; then + if [ -e /etc/conf.d/local.stop ]; then . /etc/conf.d/local.stop fi diff --git a/init.d/localmount b/init.d/localmount index 9823820c..d05822ec 100755 --- a/init.d/localmount +++ b/init.d/localmount @@ -58,7 +58,7 @@ stop() { for x in ${no_umounts} ${RC_NO_UMOUNTS}; do no_umounts="${no_umounts}|${x}" done - if [ "${SIFS}" = "y" ] ; then + if [ "${SIFS}" = "y" ]; then IFS=$OIFS else unset IFS diff --git a/init.d/netmount b/init.d/netmount index 8742f9e0..08cdf42d 100755 --- a/init.d/netmount +++ b/init.d/netmount @@ -30,9 +30,9 @@ need_portmap() { local mnt opts ret IFS=" " set -- $(fstabinfo --fstype nfs,nfs4) - for mnt in "$@" ; do + for mnt in "$@"; do case ,$(fstabinfo --options "${mnt}"), in - *,noauto,*|*,nolock,*) ;; + *,noauto,*|*,nolock,*);; *) return 0;; esac done @@ -89,7 +89,7 @@ stop() { ebegin "Unmounting network filesystems" . "${RC_LIBDIR}/sh/rc-mount.sh" - for x in ${net_fs_list} ; do + for x in ${net_fs_list}; do fs="${fs}${fs:+,}${x}" done if [ -n "${fs}" ]; then diff --git a/init.d/rmnologin b/init.d/rmnologin index c5254e65..925ddcaf 100755 --- a/init.d/rmnologin +++ b/init.d/rmnologin @@ -32,7 +32,7 @@ depend() { } start() { - if [ -f /etc/nologin.boot ] ; then + if [ -f /etc/nologin.boot ]; then rm -f /etc/nologin /etc/nologin.boot fi } diff --git a/init.d/urandom b/init.d/urandom index 9a03068b..5d3a8404 100755 --- a/init.d/urandom +++ b/init.d/urandom @@ -35,7 +35,7 @@ depend() { save_seed() { local poolsize=1 - if [ -e /proc/sys/kernel/random/poolsize ] ; then + if [ -e /proc/sys/kernel/random/poolsize ]; then poolsize=$(($(cat /proc/sys/kernel/random/poolsize) / 4096)) fi @@ -47,7 +47,7 @@ save_seed() { start() { [ -c /dev/urandom ] || return - if [ -f "${urandom_seed}" ] ; then + if [ -f "${urandom_seed}" ]; then ebegin "Initializing random number generator" cat "${urandom_seed}" > /dev/urandom eend $? "Error initializing random number generator" |