Free Hosting Online for WorkStations

< Previous | Contents | Next >

D.10. /etc/rc.d/init.d/udev_retry‌


#!/bin/sh

########################################################################

# Begin udev_retry

#

# Description : Udev cold-plugging script (retry)

#

#!/bin/sh

########################################################################

# Begin udev_retry

#

# Description : Udev cold-plugging script (retry)

#


# Authors

#

# Update

#

#

# Version

#

# Authors

#

# Update

#

#

# Version

#


########################################################################

########################################################################


### BEGIN INIT INFO

# Provides:

# Required-Start:

# Should-Start:

# Required-Stop:

# Should-Stop:

# Default-Start:

# Default-Stop:

# Short-Description:

# Description:

#

#

# X-LFS-Provided-By:

### END INIT INFO

### BEGIN INIT INFO

# Provides:

# Required-Start:

# Should-Start:

# Required-Stop:

# Should-Stop:

# Default-Start:

# Default-Stop:

# Short-Description:

# Description:

#

#

# X-LFS-Provided-By:

### END INIT INFO


. /lib/lsb/init-functions


case "${1}" in start)

log_info_msg "Retrying failed uevents, if any..."


# As of udev-186, the --run option is no longer valid

#rundir=$(/sbin/udevadm info --run)

. /lib/lsb/init-functions


case "${1}" in start)

log_info_msg "Retrying failed uevents, if any..."


# As of udev-186, the --run option is no longer valid

#rundir=$(/sbin/udevadm info --run)



rundir=/run/udev

# From Debian: "copy the rules generated before / was mounted

# read-write":


for file in ${rundir}/tmp-rules--*; do dest=${file##*tmp-rules--}

[ "$dest" = '*' ] && break

cat $file >> /etc/udev/rules.d/$dest rm -f $file

done


# Re-trigger the uevents that may have failed,

# in hope they will succeed now

/bin/sed -e 's/#.*$//' /etc/sysconfig/udev_retry | /bin/grep -v '^$' | \ while read line ; do

for subsystem in $line ; do

/sbin/udevadm trigger --subsystem-match=$subsystem --action=add done

done


# Now wait for udevd to process the uevents we triggered if ! is_true "$OMIT_UDEV_RETRY_SETTLE"; then

/sbin/udevadm settle

fi


evaluate_retval

;;


*)

echo "Usage ${0} {start}" exit 1

;;

esac exit 0

# End udev_retry

rundir=/run/udev

# From Debian: "copy the rules generated before / was mounted

# read-write":


for file in ${rundir}/tmp-rules--*; do dest=${file##*tmp-rules--}

[ "$dest" = '*' ] && break

cat $file >> /etc/udev/rules.d/$dest rm -f $file

done


# Re-trigger the uevents that may have failed,

# in hope they will succeed now

/bin/sed -e 's/#.*$//' /etc/sysconfig/udev_retry | /bin/grep -v '^$' | \ while read line ; do

for subsystem in $line ; do

/sbin/udevadm trigger --subsystem-match=$subsystem --action=add done

done


# Now wait for udevd to process the uevents we triggered if ! is_true "$OMIT_UDEV_RETRY_SETTLE"; then

/sbin/udevadm settle

fi


evaluate_retval

;;


*)

echo "Usage ${0} {start}" exit 1

;;

esac exit 0

# End udev_retry


: Gerard Beekmans - gerard@linuxfromscratch.org DJ Lucas - dj@linuxfromscratch.org

: Bruce Dubbs - bdubbs@linuxfromscratch.org

: Gerard Beekmans - gerard@linuxfromscratch.org DJ Lucas - dj@linuxfromscratch.org

: Bruce Dubbs - bdubbs@linuxfromscratch.org

: LFS 7.0

: LFS 7.0

Top OS Cloud Computing at OnWorks: