forked from mirrors/nixpkgs
* 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;
|
||||
})
|
||||
|
||||
# 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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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=
|
||||
|
|
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…
Reference in a new issue