Commit Graph

501 Commits

Author SHA1 Message Date
Mathijs Kwik
ebf4816717 systemd mount units: use 'escapeSystemdPath' from lib/utils 2013-01-01 14:53:54 +01:00
Mathijs Kwik
16a9bcfe81 add support for systemd mount units
This is mainly useful for specifying mounts that depend on other
units. For example sshfs or davfs need network (and possibly
nameservices).

While systemd makes a distinction between local and remote
filesystems, this only works for in-kernel filesystems such as
nfs and cifs.

fuse-based filesystems (such as sshfs and davs) are classified as
local, so they fail without networking. By explicitly declaring these
mounts as full systemd units (as opposed to having systemd generate
them automatically from /etc/fstab), dependencies can be specified as
on every other unit.

In the future, we can probably port NixOS' filesystems handling to use
these native systemd.mount units and skip /etc/fstab altogether, but
this probably requires additional changes, such as starting systemd
even earlier during boot (stage 1).
2013-01-01 13:55:48 +01:00
Mathijs Kwik
244ed6ae71 nscd: use proper systemd.special(7) targets 2012-12-27 12:23:50 +01:00
Shea Levy
75ec5c609e Merge remote-tracking branch 'upstream/master' into systemd
Conflicts:
	maintainers/scripts/ec2/create-ebs-amis.py
2012-12-17 13:03:56 -05:00
Shea Levy
835ee30b32 Merge branch 'no-aufs' into systemd 2012-12-17 13:02:35 -05:00
Lluís Batlle i Rossell
358239348a making memtest grub entries work again
I'm not any good at perl, and I only came up with this after many
slow attempts. Any review welcome.

But until this, memtest was broken, and extraPrepareConfig as well, in grub.
2012-12-16 21:41:47 +01:00
Rob Vermaas
39a6143c66 Add options to control rate limiting behaviour of journald. See 'man journald.conf' for more information. 2012-12-16 20:28:45 +01:00
Shea Levy
dfca6b97f1 Remove last mention of aufs for completeness 2012-12-16 13:33:23 -05:00
Shea Levy
be4f69519b iso-image: Use unionfs-fuse instead of aufs 2012-12-16 11:31:52 -05:00
Eelco Dolstra
bd7ea9be58 sysinit.target: Drop the dependency on local-fs.target and swap.target
Having all services with DefaultDependencies=yes depend on
local-fs.target is annoying, because some of those services might be
necessary to mount local filesystems.  For instance, Charon's
send-keys feature requires sshd to be running in order to receive LUKS
encryption keys, which in turn requires dhcpcd, and so on.  So we drop
this dependency (and swap.target as well for consistency).  If
services require a specific mount, they should use RequiresMountsFor
in any case.
2012-12-14 17:42:54 +01:00
Eelco Dolstra
b1da38f564 Merge remote-tracking branch 'origin/master' into systemd 2012-11-30 16:12:04 +01:00
Eelco Dolstra
3c6e0fd594 Generate the binary hardware database required by systemd 196 2012-11-29 18:51:44 +01:00
Eelco Dolstra
60bf4c3cd7 Add a GRUB 1 dependency
http://hydra.nixos.org/build/3331139
2012-11-16 16:42:45 +01:00
Eelco Dolstra
1f401a0e35 Make install-grub.pl work when $PATH is empty 2012-11-15 22:54:43 +01:00
aszlig
a333f7212e systemd: Fail if kernel features are missing.
This has rendered my system unbootable, because I forgot to enable AUTOFS4 in my
custom kernel. In addition to AUTOFS4, this includes (hopefully) all other
kernel features needed by systemd, as listed in the README:

REQUIREMENTS:
  Linux kernel >= 2.6.39
    with devtmpfs
    with cgroups (but it's OK to disable all controllers)
    optional but strongly recommended: autofs4, ipv6

Autofs4 is not a requirement here, but in our case it turns out that the system
is not able to boot properly with a LUKS-enabled system (or at least not on _my_
system).

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2012-11-06 11:25:43 +01:00
Eelco Dolstra
458f36f5f1 Turn fileSystems into an attribute set
So now you can write

  fileSystems =
    [ { mountPoint = "/";
        device = "/dev/sda1";
      }
    ];

as

  fileSystems."/".device = "/dev/sda1";
2012-11-02 18:02:12 +01:00
Eelco Dolstra
93f82dfeef Remove outdated comment about EC2 booting into stage-2 directly 2012-11-02 17:07:53 +01:00
Eelco Dolstra
af4e176c12 Fix description 2012-11-02 14:10:06 +01:00
Eelco Dolstra
48a0ea0513 Make Apache wait for ‘charon send-keys’
(This is a no-op on non-Charon deployments since the ‘keys.target’
unit won't have any dependencies.)
2012-11-01 23:32:12 +01:00
Eelco Dolstra
1da362b34b Fix coverage data collection
http://hydra.nixos.org/build/3253046
2012-10-30 17:27:14 +01:00
Eelco Dolstra
1a82024dd8 In the tests, don't start agetty on /dev/ttyS0
Running agetty on ttyS0 interferes with the backdoor, which uses ttyS0
as its standard error.  After agetty starts, writes to the stderr file
descriptor will return EIO (though doing "exec 2>/proc/self/fd/2" will
miracuously fix this).

http://hydra.nixos.org/build/3252782
2012-10-29 21:10:00 +01:00
Eelco Dolstra
23390147ea upstart.nix: Treat "daemon" as "forking" 2012-10-26 16:22:19 +02:00
Eelco Dolstra
b3c5d42b1d Don't create /var/log/upstart 2012-10-26 16:22:18 +02:00
Lluís Batlle i Rossell
82d39c9ca4 Fixing stage1 about getting a shell with job control in case of error
It's a busybox faq:
http://www.busybox.net/FAQ.html#job_control
2012-10-24 21:49:10 +02:00
Eelco Dolstra
c980faebe2 upstart.nix: Set ‘Type’ to ‘oneshot’ for Upstart tasks
This way the service will only reach the "started" state when the task
has finished.
2012-10-23 08:30:50 -04:00
Eelco Dolstra
e5fa3f108e Set uniqueness constraint on boot.devShmSize etc. 2012-10-23 07:50:23 -04:00
Eelco Dolstra
06cbe62537 switch-to-configuration: Support services activated by multiple sockets 2012-10-18 13:26:47 -04:00
Eelco Dolstra
b4a1893cdd systemd-vconsole-setup: Don't put the X server in non-raw mode
‘systemd-vconsole-setup’ by default operates on /dev/tty0, the
currently active tty.  Since it puts /dev/tty0 in Unicode or ASCII
mode, if the X server is currently active when it runs, keys such as
Alt-F4 won't reach the X server anymore.  So use /dev/tty1 instead.
2012-10-18 11:58:37 -04:00
Eelco Dolstra
a4cad32c3d Generate more user-friendly script filenames
This is primarily important in journal entries.
2012-10-18 11:58:37 -04:00
Eelco Dolstra
10ac80115b switch-to-configuration: Fix bad Perl 2012-10-14 21:12:11 -04:00
Eelco Dolstra
53f216885f Ignore systemd-modules-load errors
On NixOS, ‘boot.kernelModules’ has historically contained modules that
may not exist or load everywhere, so don't barf on those.
2012-10-12 17:39:06 -04:00
Eelco Dolstra
12d1cd87ce Systemd unit names can contain Nix-illegal characters, so don't include them 2012-10-12 17:32:05 -04:00
Eelco Dolstra
97a2de983b Ensure that swap.target is pulled in by switch-to-configuration even if it failed earlier 2012-10-12 16:38:00 -04:00
Eelco Dolstra
fd7dbc99ab switch-to-configuration: Handle multiple swap devices properly 2012-10-12 16:37:14 -04:00
Eelco Dolstra
b968244aa1 Move fs.target to filesystems.nix 2012-10-12 15:08:44 -04:00
Eelco Dolstra
d63da5892c Ensure that systemd-modules-load is restarted when boot.kernelModules changes 2012-10-11 17:58:46 -04:00
Eelco Dolstra
b606165bd9 Allow a unit to declare "triggers" that force a restart
The triggers are just arbitrary strings that are included in the unit
under X-Restart-Triggers.  The idea is that if they change between
reconfigurations, switch-to-configuration will restart the unit
because its store path changed.  This is mostly useful for services
that implicitly depend on generated files in /etc.  Thus you can say

  restartTriggers = [ confFile ];

where ‘confFile’ is the derivation that generated the /etc file in
question.
2012-10-11 17:54:43 -04:00
Eelco Dolstra
285f587025 Move non-interface specific initialisation to ‘network-setup.service’
The unit ‘network-interface.service’ has been replaced by
‘network-interfaces.target’.
2012-10-11 16:18:48 -04:00
Eelco Dolstra
4104f60800 Fix accidental commit 2012-10-11 12:43:08 -04:00
Eelco Dolstra
d7458b5fc2 Split the monolithic network-interface service into multiple units
For each statically configured interface, we now create a unit
‘<interface>-cfg.service’ which gets started as soon as the network
device comes up.  Similarly, each bridge defined in
‘networking.bridges’ and virtual interface in ‘networking.interfaces’
is created by a service ‘<interface>.service’.

So if we have

  networking.bridges.br0.interfaces = [ "eth0" "eth1" ];
  networking.interfaces =
    [ { name = "br0";
        ipAddress = "192.168.1.1";
      }
    ];

then there will be a unit ‘br0.service’ that depends on
‘sys-subsystem-net-devices-eth0.device’ and
‘sys-subsystem-net-devices-eth1.device’, and a unit ‘br0-cfg.service’
that depends on ‘sys-subsystem-net-devices-br0.device’.
2012-10-10 17:55:42 -04:00
Eelco Dolstra
62b707de07 Add support for postStop scripts 2012-10-10 17:55:13 -04:00
Eelco Dolstra
17a7f48364 Add an option for BindsTo dependencies 2012-10-10 16:50:41 -04:00
Eelco Dolstra
6b185a131f Use config.system.build.systemd in the toplevel derivation 2012-10-10 16:49:59 -04:00
Eelco Dolstra
d71c0bb834 Respect partOf etc. for socket and target units 2012-10-09 15:14:15 -04:00
Eelco Dolstra
f451afea8f Remove ‘services.journald.logKernelMessages’
This option no longer exists in systemd.
2012-10-08 10:51:17 -04:00
Eelco Dolstra
52483c36bb Lowercase debug output 2012-10-04 21:44:45 -04:00
Eelco Dolstra
fdea3ac3d2 stage-2-init: Don't rely on groups being initialised 2012-10-04 16:15:30 -04:00
Eelco Dolstra
666620cdd5 Use ‘mountpoint -q’ 2012-10-02 10:32:56 -04:00
Eelco Dolstra
2044ae785d Use "wants" instead of "requires" 2012-10-02 10:32:29 -04:00
Eelco Dolstra
7932978617 Fix Upstart compatibility jobs that depend on "stopped udevtrigger"
It's not enough to say "after udev-settle.service" since
udev-settle.service is not wanted/required anywhere - we need to say
"wants udev-settle.service" as well.

This should fix problems with ALSA and X11 initialisation that people
have been seeing.
2012-10-02 10:31:02 -04:00