From c6adbe7a36a7330debfaa07d4351bcd80d479214 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sat, 4 Jun 2011 19:55:36 -0400 Subject: add PATH, strip absolute path from binaries Since we're declaring a PATH anyways, we may as well use it. This gives us immunity against binaries moving around, as in the recent case of iproute2. A few other minor, associated, tweaks to go along with this: * any -x tests are modified to use 'type -P' to resolve the path before checking for execute permission * any pidof checks are stripped of paths as well. --- rc.single | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'rc.single') diff --git a/rc.single b/rc.single index 92b8f53..c754eb1 100755 --- a/rc.single +++ b/rc.single @@ -6,25 +6,27 @@ . /etc/rc.conf . /etc/rc.d/functions +export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + run_hook single_start if [[ $PREVLEVEL != N ]]; then kill_everything single - status "Starting UDev Daemon" /sbin/udevd --daemon + status "Starting UDev Daemon" udevd --daemon run_hook single_udevlaunched # Trigger udev uevents - if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then + if pidof -o %PPID /udevd >/dev/null; then stat_busy "Triggering UDev uevents" - /sbin/udevadm trigger --action=add --type=subsystems - /sbin/udevadm trigger --action=add --type=devices + udevadm trigger --action=add --type=subsystems + udevadm trigger --action=add --type=devices stat_done fi # Wait for udev uevents - if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then + if pidof -o %PPID udevd >/dev/null; then status "Waiting for UDev uevents to be processed" \ - /sbin/udevadm settle --quiet --timeout=${UDEV_TIMEOUT:-30} + udevadm settle --quiet --timeout=${UDEV_TIMEOUT:-30} fi run_hook single_udevsettled @@ -45,12 +47,12 @@ if [[ $RUNLEVEL = 1 ]]; then printhl "Entering single-user mode..." # make sure /dev/initctl is in place kill -HUP 1 - exec /sbin/init -t1 S + exec init -t1 S fi -/bin/touch /var/log/boot -kill $(/bin/cat /run/bootlogd.pid) -/bin/rm /run/bootlogd.pid +touch /var/log/boot +kill $(< /run/bootlogd.pid) +rm /run/bootlogd.pid # End of file # vim: set ts=2 sw=2 noet: -- cgit v1.2.3