mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-28 08:33:54 +00:00
d545d08461
statically configured interface (i.e. we're not running dhclient). Otherwise the ntpd job won't be triggered. * Use the "-n" flag of "initctl emit" to send the event asynchronously. svn path=/nixos/branches/upstart-0.6/; revision=18227
35 lines
751 B
Nix
35 lines
751 B
Nix
{ config, pkgs, ... }:
|
|
|
|
{
|
|
|
|
###### implementation
|
|
|
|
config = {
|
|
|
|
jobs.lvm =
|
|
{ startOn = "started udev or new-devices";
|
|
|
|
script =
|
|
''
|
|
# Load the device mapper.
|
|
${config.system.sbin.modprobe}/sbin/modprobe dm_mod || true
|
|
|
|
${pkgs.devicemapper}/sbin/dmsetup mknodes
|
|
# Scan for block devices that might contain LVM physical volumes
|
|
# and volume groups.
|
|
${pkgs.lvm2}/sbin/vgscan --mknodes
|
|
|
|
# Make all logical volumes on all volume groups available, i.e.,
|
|
# make them appear in /dev.
|
|
${pkgs.lvm2}/sbin/vgchange --available y
|
|
|
|
initctl emit -n new-devices
|
|
'';
|
|
|
|
task = true;
|
|
};
|
|
|
|
};
|
|
|
|
}
|