3
0
Fork 0
forked from mirrors/nixpkgs

* Move starting of udevd (and udevtrigger/settle) into an Upstart

job.

svn path=/nixos/trunk/; revision=7330
This commit is contained in:
Eelco Dolstra 2006-12-13 12:17:38 +00:00
parent 4b5b0d2c66
commit 07627d8cdd
5 changed files with 39 additions and 15 deletions

View file

@ -88,19 +88,6 @@ mknod -m 0666 /dev/null c 1 3
export MODULE_DIR=@kernel@/lib/modules/
# Start udev.
udevd --daemon
# Let udev create device nodes for all modules that have already been
# loaded into the kernel (or for which support is built into the
# kernel).
udevtrigger
udevsettle # wait for udev to finish
chmod 666 /dev/null # grmbl
# Start an interactive shell.
#exec @shell@

View file

@ -17,6 +17,12 @@ import ../upstart-jobs/gather.nix {
inherit (pkgs) sysklogd;
})
# The udev daemon creates devices nodes and runs programs when
# hardware events occur.
(import ../upstart-jobs/udev.nix {
inherit (pkgs) udev procps;
})
# Hardware scan; loads modules for PCI devices.
(import ../upstart-jobs/hardware-scan.nix {
inherit (pkgs) kernel module_init_tools;

View file

@ -5,7 +5,7 @@
name = "hardware-scan";
job = "
start on startup
start on udev
script
export MODULE_DIR=${kernel}/lib/modules/

View file

@ -3,7 +3,7 @@
{
name = "syslogd";
job = "
start on startup
start on udev
stop on shutdown
respawn ${sysklogd}/sbin/syslogd -n
";

31
upstart-jobs/udev.nix Normal file
View file

@ -0,0 +1,31 @@
{udev, procps}:
{
name = "udev";
job = "
start on startup
stop on shutdown
start script
echo '' > /proc/sys/kernel/hotplug
# Start udev.
${udev}/sbin/udevd --daemon
# Let udev create device nodes for all modules that have already
# been loaded into the kernel (or for which support is built into
# the kernel).
${udev}/sbin/udevtrigger
${udev}/sbin/udevsettle # wait for udev to finish
# Kill udev, let Upstart restart and monitor it. (This is nasty,
# but we have to run udevtrigger first. Maybe we can use
# Upstart's `binary' keyword, but it isn't implemented yet.)
${procps}/bin/pkill -u root '^udevd$'
end script
respawn ${udev}/sbin/udevd
";
}