aboutsummaryrefslogtreecommitdiff
path: root/rc.single
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-06-04 19:55:36 -0400
committerTom Gundersen <teg@jklm.no>2011-06-05 02:24:30 +0200
commitc6adbe7a36a7330debfaa07d4351bcd80d479214 (patch)
tree1939b750a00b1c146fbee0a712b88c280c2a6e4f /rc.single
parent0dfd69b9e8617ef15413e5022442017603be5344 (diff)
downloadinitscripts-c6adbe7a36a7330debfaa07d4351bcd80d479214.tar.xz
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.
Diffstat (limited to 'rc.single')
-rwxr-xr-xrc.single22
1 files changed, 12 insertions, 10 deletions
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: