* Some more upstartification.

svn path=/nixu/trunk/; revision=7081
This commit is contained in:
Eelco Dolstra 2006-11-20 17:06:44 +00:00
parent 369b48eadf
commit 962b1df3aa
5 changed files with 45 additions and 13 deletions

View file

@ -87,6 +87,11 @@ rec {
inherit (pkgs) sysklogd;
})
# Network interfaces.
(import ./upstart-jobs/network-interfaces.nix {
inherit (pkgs) nettools kernel;
})
# DHCP client.
(import ./upstart-jobs/dhclient.nix {
dhcp = pkgs.dhcpWrapper;
@ -117,7 +122,7 @@ rec {
bootStage2 = import ./boot-stage-2.nix {
inherit (pkgs) genericSubstituter coreutils findutils
utillinux kernel udev module_init_tools
nettools upstart;
upstart;
inherit upstartJobs;
shell = pkgs.bash + "/bin/sh";
@ -137,6 +142,7 @@ rec {
pkgs.less
pkgs.nano
pkgs.netcat
pkgs.nettools
pkgs.perl
pkgs.procps
pkgs.rsync

View file

@ -82,14 +82,6 @@ for i in /sys/bus/pci/devices/*/modalias; do
done
# Bring up the network devices.
modprobe af_packet
for i in $(cd /sys/class/net && ls -d *); do
echo "Bringing up network device $i..."
ifconfig $i up
done
# login/su absolutely need this.
test -e /etc/login.defs || touch /etc/login.defs

View file

@ -1,6 +1,6 @@
{ genericSubstituter, shell, coreutils, findutils
, utillinux, kernel, udev
, module_init_tools, nettools, upstart
, module_init_tools, upstart
, path ? []
, # Whether the root device is root only. If so, we'll mount a
@ -21,7 +21,6 @@ genericSubstituter {
utillinux
udev
module_init_tools
nettools
upstart
];
extraPath = path;

View file

@ -6,8 +6,8 @@
job = "
description \"DHCP client\"
start on startup
stop on shutdown
start on network-interfaces
stop on network-interfaces/stop
script
interfaces=

View file

@ -0,0 +1,35 @@
# !!! Don't like it that I have to pass the kernel here.
{nettools, kernel}:
{
name = "network-interfaces";
job = "
start on startup
stop on shutdown
start script
export MODULE_DIR=${kernel}/lib/modules/
modprobe af_packet
for i in $(cd /sys/class/net && ls -d *); do
echo \"Bringing up network device $i...\"
${nettools}/sbin/ifconfig $i up || true
done
end script
# Hack: Upstart doesn't yet support what we want: a service that
# doesn't have a running process associated with it.
respawn sleep 10000
stop script
for i in $(cd /sys/class/net && ls -d *); do
echo \"Bringing up network device $i...\"
${nettools}/sbin/ifconfig $i down || true
done
end script
";
}