[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH 4/5] Ubuntu: Prefer starting udev by hand, instead of using init script.



Now this is a tricky patch.  In Ubuntu everything uses upstart and the
udev script in particular has been converted to use upstart.  The
problem with this is that upstart isn't running, can't be run, and
isn't desirable for minimal appliances even if we could run it.  There
is no alternative non-upstart way to start udev.

Hence we start udev by hand with a sequence of commands, roughly based
on 'start_udev' that Fedora ships, but greatly simplified.

These commands seem to be the minimal ones which are necessary to
start udevd, although in fine tradition nothing is documented
anywhere.

I haven't tested whether this sequence of commands is suitable for
Fedora or Debian yet.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
>From 14a1f93d15c5d243947e0e0365fea4ea89d04e82 Mon Sep 17 00:00:00 2001
From: Richard Jones <rjones ubuntu910x64 home annexia org>
Date: Mon, 21 Dec 2009 15:54:30 +0000
Subject: [PATCH 4/5] Ubuntu: Prefer starting udev by hand, instead of using init script.

---
 appliance/init |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/appliance/init b/appliance/init
index 75eb03e..f208f1e 100755
--- a/appliance/init
+++ b/appliance/init
@@ -7,7 +7,12 @@ PATH=/sbin:/usr/sbin:$PATH
 mount -t proc /proc /proc
 mount -t sysfs /sys /sys
 
-if [ -x /etc/init.d/udev ]; then
+if [ -x /sbin/udevd ]; then
+  echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
+  /sbin/udevd --daemon
+  /sbin/udevadm trigger
+  /sbin/udevadm settle --timeout=10
+elif [ -x /etc/init.d/udev ]; then
   service udev start
 elif [ -x /sbin/start_udev ] && /sbin/start_udev; then
   :
-- 
1.6.3.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]