* Some more upstartification.
svn path=/nixu/trunk/; revision=7081
This commit is contained in:
parent
369b48eadf
commit
962b1df3aa
@ -87,6 +87,11 @@ rec {
|
|||||||
inherit (pkgs) sysklogd;
|
inherit (pkgs) sysklogd;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
# Network interfaces.
|
||||||
|
(import ./upstart-jobs/network-interfaces.nix {
|
||||||
|
inherit (pkgs) nettools kernel;
|
||||||
|
})
|
||||||
|
|
||||||
# DHCP client.
|
# DHCP client.
|
||||||
(import ./upstart-jobs/dhclient.nix {
|
(import ./upstart-jobs/dhclient.nix {
|
||||||
dhcp = pkgs.dhcpWrapper;
|
dhcp = pkgs.dhcpWrapper;
|
||||||
@ -117,7 +122,7 @@ rec {
|
|||||||
bootStage2 = import ./boot-stage-2.nix {
|
bootStage2 = import ./boot-stage-2.nix {
|
||||||
inherit (pkgs) genericSubstituter coreutils findutils
|
inherit (pkgs) genericSubstituter coreutils findutils
|
||||||
utillinux kernel udev module_init_tools
|
utillinux kernel udev module_init_tools
|
||||||
nettools upstart;
|
upstart;
|
||||||
inherit upstartJobs;
|
inherit upstartJobs;
|
||||||
shell = pkgs.bash + "/bin/sh";
|
shell = pkgs.bash + "/bin/sh";
|
||||||
|
|
||||||
@ -137,6 +142,7 @@ rec {
|
|||||||
pkgs.less
|
pkgs.less
|
||||||
pkgs.nano
|
pkgs.nano
|
||||||
pkgs.netcat
|
pkgs.netcat
|
||||||
|
pkgs.nettools
|
||||||
pkgs.perl
|
pkgs.perl
|
||||||
pkgs.procps
|
pkgs.procps
|
||||||
pkgs.rsync
|
pkgs.rsync
|
||||||
|
@ -82,14 +82,6 @@ for i in /sys/bus/pci/devices/*/modalias; do
|
|||||||
done
|
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.
|
# login/su absolutely need this.
|
||||||
test -e /etc/login.defs || touch /etc/login.defs
|
test -e /etc/login.defs || touch /etc/login.defs
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{ genericSubstituter, shell, coreutils, findutils
|
{ genericSubstituter, shell, coreutils, findutils
|
||||||
, utillinux, kernel, udev
|
, utillinux, kernel, udev
|
||||||
, module_init_tools, nettools, upstart
|
, module_init_tools, upstart
|
||||||
, path ? []
|
, path ? []
|
||||||
|
|
||||||
, # Whether the root device is root only. If so, we'll mount a
|
, # Whether the root device is root only. If so, we'll mount a
|
||||||
@ -21,7 +21,6 @@ genericSubstituter {
|
|||||||
utillinux
|
utillinux
|
||||||
udev
|
udev
|
||||||
module_init_tools
|
module_init_tools
|
||||||
nettools
|
|
||||||
upstart
|
upstart
|
||||||
];
|
];
|
||||||
extraPath = path;
|
extraPath = path;
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
job = "
|
job = "
|
||||||
description \"DHCP client\"
|
description \"DHCP client\"
|
||||||
|
|
||||||
start on startup
|
start on network-interfaces
|
||||||
stop on shutdown
|
stop on network-interfaces/stop
|
||||||
|
|
||||||
script
|
script
|
||||||
interfaces=
|
interfaces=
|
||||||
|
35
test/upstart-jobs/network-interfaces.nix
Normal file
35
test/upstart-jobs/network-interfaces.nix
Normal 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
|
||||||
|
|
||||||
|
";
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user