3 # rawdevices This shell script assignes rawdevices to block devices
6 # description: This scripts assignes raw devices to block devices \
7 # (such as hard drive partitions). This is for the use \
8 # of applications such as Oracle. You can set up the \
9 # raw device to block device mapping by editing \
10 # the file /etc/sysconfig/rawdevices.
11 # config: /etc/sysconfig/rawdevices
13 [ -f /etc/sysconfig/rawdevices ] || exit 0
15 # If the file just has the default comments, exit.
16 grep -q -v "^#" /etc/sysconfig/rawdevices 2>/dev/null || exit 0
18 # Source function library.
19 . /etc/rc.d/init.d/functions
23 cat /etc/sysconfig/rawdevices | egrep -v '^ *#' | while read RAW BLOCK; do
24 if [ -n "$RAW" -a -n "$BLOCK" ]; then
25 if [ "`dirname $RAW`" = "/dev" -a -d /dev/raw ]; then
26 nls " Please correct your /etc/sysconfig/rawdevices:"
27 nls " rawdevices are now located in the directory /dev/raw/ "
28 nls " If the command 'raw' still refers to /dev/raw as a file."
29 nls " You'll have to upgrade your util-linux package"
32 if [ "`dirname $RAW`" = "/dev/raw" -a -f /dev/raw ]; then
33 nls " Please correct your /etc/sysconfig/rawdevices:"
34 nls " rawdevices are now located in the directory /dev/raw/ "
35 nls " If the command 'raw' still refers to /dev/raw as a file."
36 nls " You'll have to upgrade your util-linux package"
40 show "$(nls "Assigning device: %s --> %s" "$RAW" "$BLOCK")"
42 raw $RAW $BLOCK > /dev/null
49 if [ ! -f /var/lock/subsys/rawdevices ]; then
50 msg_starting rawdevices
53 touch /var/lock/subsys/rawdevices
55 msg_already_running rawdevices
60 if [ -f /var/lock/subsys/rawdevices ]; then
61 msg_stopping rawdevices
63 rm -f /var/lock/subsys/rawdevices >/dev/null 2>&1
66 msg_not_running rawdevices
70 # See how we were called.
87 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"