summaryrefslogtreecommitdiff
path: root/etc/init.d
diff options
context:
space:
mode:
authorgreg@kroah.com <greg@kroah.com>2003-12-24 21:47:14 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:13:10 -0700
commit18c783a7e6acab9590980a54978a129f7b3dca81 (patch)
treebd12a7ed29f3f4897a71016e4e7fd7531b973ef6 /etc/init.d
parent5779dd31f49b41d52d1f08c2eb4239926fa58864 (diff)
[PATCH] more init script cleanups, the stop target now calls udev to cleanup instead of just removing the whole /udev directory.
Diffstat (limited to 'etc/init.d')
-rw-r--r--etc/init.d/udev39
1 files changed, 21 insertions, 18 deletions
diff --git a/etc/init.d/udev b/etc/init.d/udev
index c540057d21..0d26d07083 100644
--- a/etc/init.d/udev
+++ b/etc/init.d/udev
@@ -11,20 +11,8 @@ udev_dir=/udev
sysfs_dir=/sys
bin=/sbin/udev
-case "$1" in
- start)
- if [ ! -d $udev_dir ]; then
- mkdir $udev_dir
- fi
- if [ ! -d $sysfs_dir ]; then
- exit 1
- fi
- # propogate /udev from /sys - we only need this while we do not
- # have initramfs and an early user-space with which to do early
- # device bring up
- action "Creating initial udev device nodes: " /bin/true
- export ACTION=add
- # add block devices and their partitions
+run_udev () {
+ # handle block devices and their partitions
for i in ${sysfs_dir}/block/*; do
# add each drive
export DEVPATH=${i#${sysfs_dir}}
@@ -49,14 +37,29 @@ case "$1" in
fi
done
done
+}
+
+
+case "$1" in
+ start)
+ if [ ! -d $udev_dir ]; then
+ mkdir $udev_dir
+ fi
+ if [ ! -d $sysfs_dir ]; then
+ exit 1
+ fi
+ # propogate /udev from /sys - we only need this while we do not
+ # have initramfs and an early user-space with which to do early
+ # device bring up
+ action "Creating initial udev device nodes: " /bin/true
+ export ACTION=add
+ run_udev
;;
stop)
# be careful
action "Removing udev device nodes: " /bin/true
- if [ $udev_dir -a "$udev_dir" != "/" ]; then
- # clear out /udev
- rm -rf ${udev_dir}/*
- fi
+ export ACTION=remove
+ run_udev
;;
status)
if [ -d $udev_dir ]; then