[arch-projects] [RFC 08/23] Check for udevd to avoid waiting for devices

Matthew Monaco dgbaley27 at 0x01b.net
Fri May 18 12:22:02 EDT 2012


From: Matthew Monaco <matthew.monaco at 0x01b.net>

Without udevd, it is unlikely that new devices are going to show up. So
we will know not to wait for them.

Suggested-by: Dave Reisner <dreisner at archlinux.org>
---
 cryptmount.sh |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/cryptmount.sh b/cryptmount.sh
index bdfd1a1..88771bc 100755
--- a/cryptmount.sh
+++ b/cryptmount.sh
@@ -2,6 +2,7 @@
 
 SHORTOPTS="LMUc:w:nqvho:O:"
 DEPS="cryptsetup blkid findmnt mkswap mktemp"
+UDEVRUNNING=0
 
 LOGLEVEL=1
 DRYRUN=0
@@ -140,6 +141,14 @@ ct_main() {
 		type $dep &> /dev/null || info "$dep not found, some functionality may fail"
 	done
 
+	# Check for UDEV
+	if pidof udevd &>/dev/null; then
+		UDEVRUNNING=1
+		info "Detected udevd"
+	else
+		info "udevd not running, or unable to detect it: waiting for devices disabled"
+	fi
+
 	if [ -z "$action" -o "$action" = "list" ]; then
 
 		if [ $# -ne 0 ]; then
-- 
1.7.10.2



More information about the arch-projects mailing list