Commit Graph

152 Commits

Author SHA1 Message Date
Evgeny Egorochkin
b415876bdb systemd service: fix issues with escaping when unit name contains '-'
systemd escaping rules translate this into a string containing '\'
which is treated by some code paths as quoted, and by others as unquoted
causing the affected units to fail.
2014-06-11 04:08:13 +03:00
lethalman
f5aeae49ef Merge pull request #2837 from lethalman/security
Add system.replaceRuntimeDependencies to quickly replace system dependencies
2014-06-09 15:42:59 +02:00
Luca Bruno
66ddb1c322 Add system.replaceRuntimeDependencies to quickly replace system dependencies 2014-06-06 21:17:31 +02:00
Eelco Dolstra
906aa9ccb1 Make pseudo-filesystems show up as "tmpfs" etc. rather than "none" in df 2014-06-05 13:39:17 +02:00
Shea Levy
57ed344917 Fix /run/keys permissions 2014-05-27 17:22:25 -04:00
Eelco Dolstra
c54eb79063 Don't kill unionfs-fuse during shutdown
Killing the daemon backing /nix/store prevents a clean shutdown.  See
http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons/
2014-05-21 15:55:50 +02:00
Eelco Dolstra
5e364503d5 NixOS ISO: Don't use a unionfs for /
We don't need a unionfs on /, we only need a tmpfs.
2014-05-21 15:55:50 +02:00
Eelco Dolstra
d4ccfe3f6b Don't create /media
It's obsolete - udisks2 uses /run/media/<username>.
2014-05-21 15:55:49 +02:00
Eelco Dolstra
bddd10d75c switch-to-configuration: Don't restart instances of user@.service
Restarting user@ instances is bad because it causes all user services
(such as ssh-agent.service) to be restarted. Maybe one day we can have
switch-to-configuration restart user units in a fine-grained way, but
for now we should just ignore user systemd instances.

Backport: 14.04
2014-05-20 11:12:56 +02:00
Emery Hemingway
c96d5fe170 nixos: f2fs filesystem module support (close #2085) 2014-05-11 13:53:26 +02:00
Eelco Dolstra
c06786759c /var/run -> /run 2014-05-09 00:52:02 +02:00
Eelco Dolstra
5bfe944907 Don't run hwclock if /dev/rtc doesn't exist
E.g. on EC2 instances.

Backport: 14.04
2014-05-05 16:47:51 +02:00
Eelco Dolstra
bac68f9747 switch-to-configuration: Honour RefuseManualStop
This prevents spurious errors about systemd-tmpfiles-setup.service.

Backport: 14.04
2014-05-05 16:46:58 +02:00
Shea Levy
e4630c1d41 grub: Allow setting the boot root explicitly
If /boot is a btrfs subvolume, it will be on a different device than /
but not be at the root from grub's perspective. This should be fixed in
a nicer way by #2449, but that can't go into 14.04.
2014-05-01 10:56:55 -04:00
Eelco Dolstra
728d3476ba systemd: Require some more kernel features 2014-04-30 13:53:12 +02:00
Eelco Dolstra
9bb209a3bd gummiboot: Automatically disable GRUB 2014-04-30 11:47:18 +02:00
Eelco Dolstra
d621300665 Revert "Don't mount /sys/fs/fuse/connections and /sys/kernel/config"
This reverts commit 6eaced3582. Doesn't
work very well, e.g. if you actually have the FUSE module loaded. And
in any case it's already fixed in NixOps.
2014-04-28 09:19:01 +02:00
Eelco Dolstra
56b4b841ae switch-to-configuration: Use old systemctl to stop units
Otherwise, when switching from systemd 203 to 212, you get errors like:

  Failed to stop remote-fs.target: Bad message
  Failed to stop systemd-udevd-control.socket: Bad message
  ...
2014-04-28 08:28:44 +02:00
Eelco Dolstra
6eaced3582 Don't mount /sys/fs/fuse/connections and /sys/kernel/config
These fail to mount if you don't have the appropriate kernel support,
and this confuses NixOps' ‘check’ command. We should teach NixOps not
to complain about non-essential mount points, but in the meantime it's
better to turn them off.
2014-04-28 08:16:27 +02:00
Eelco Dolstra
37e6e08cde switch-to-configuration: Use systemctl's --no-legend flag 2014-04-25 17:42:09 +02:00
Eelco Dolstra
da444ff26f Turn assertion about oneshot services into a warning 2014-04-22 23:53:21 +02:00
Shea Levy
7d1ddae58e nixos: evaluate assertions at toplevel, not at systemPackages
Fixes #2340
2014-04-22 14:09:02 -04:00
Eelco Dolstra
fa3826dcf4 Ignore *.wants in systemd.packages for now 2014-04-22 17:38:53 +02:00
Shea Levy
2a4282c811 Revert "Merge branch 'dbus-switch-to-configuration'"
This seems to have combined badly with the systemd upgrade, we'll revert
for now and revisit after the 14.04 branch.

This reverts commit ad80532881, reversing
changes made to 1c5d3c7883.
2014-04-21 18:30:05 -04:00
Oliver Charles
ad80532881 Merge branch 'dbus-switch-to-configuration' 2014-04-21 13:09:14 +01:00
Shea Levy
1c5d3c7883 Merge branch 'modulesfix' of git://github.com/kirelagin/nixpkgs
ohci_pci is required in initrd since kernel 3.11
2014-04-21 07:51:31 -04:00
Kirill Elagin
ca7978a09d ohci_pci is required in initrd since kernel 3.11 2014-04-21 15:42:05 +04:00
Oliver Charles
42ae633445 Merge branch 'master' into dbus-switch-to-configuration
Conflicts:
	nixos/modules/system/activation/switch-to-configuration.pl
2014-04-20 19:17:05 +01:00
Eelco Dolstra
cf53152902 Fix GRUB 2 example
Fixes #1891.
2014-04-20 19:41:15 +02:00
Eelco Dolstra
82535e0f8f switch-to-configuration: Check overrides.conf for X-* options 2014-04-19 14:28:33 +02:00
Eelco Dolstra
b03a2f9e90 Set personality when running a 32-bit container on a 64-bit host 2014-04-19 13:14:51 +02:00
Eelco Dolstra
9f1c9404da Put /var/setuid-wrappers on a tmpfs
This allows all other filesystems to be mounted without the suid
option.
2014-04-19 12:40:09 +02:00
Eelco Dolstra
2a64b0a91b Shut up warning about resolv.conf missing 2014-04-19 12:34:59 +02:00
Mathijs Kwik
bf841cd892 Revert "systemd: oneshot units should be allowed to restart on failure/abort"
This reverts commit c1e638abb6.

As pointed out by wkennington, upstream disallows all cases as of v207
2014-04-18 21:42:22 +02:00
Eelco Dolstra
febb15f722 systemd: Enable keeping backlight / rfkill state across reboots 2014-04-18 19:37:15 +02:00
Eelco Dolstra
313c38d5f1 switch-to-configuration: Handle systemctl output change 2014-04-18 19:04:45 +02:00
Eelco Dolstra
48d90cf3b6 Revert "Put /nix/var/nix/{temproots,userpool} on a tmpfs"
This reverts commit dd49094a25. Nix
barfs if /nix/var/nix/temproots is a symlink :-(
2014-04-18 18:37:07 +02:00
Eelco Dolstra
1e540af43b Fix broken upstream user unit symlinks 2014-04-18 17:38:06 +02:00
Eelco Dolstra
dd49094a25 Put /nix/var/nix/{temproots,userpool} on a tmpfs 2014-04-18 16:56:20 +02:00
Eelco Dolstra
c13cede19d Remove long-obsolete /nix/var/nix/chroots directory 2014-04-18 16:50:37 +02:00
Eelco Dolstra
21573af9fb Containers: Use /etc/resolv.conf supplied by the host
This used to work with systemd-nspawn 203, because it bind-mounted
/etc/resolv.conf (so openresolv couldn't overwrite it). Now it's just
copied, so we need some special handling.
2014-04-18 16:48:11 +02:00
Eelco Dolstra
359935a1ef kmod-static-nodes: Drop superfluous wantedBy 2014-04-18 14:51:18 +02:00
Eelco Dolstra
64b968f81f Remove debug line 2014-04-18 02:31:10 +02:00
Eelco Dolstra
12f06ae499 Doh 2014-04-18 01:36:43 +02:00
Eelco Dolstra
e34a1589fe Add support for user units
With ‘systemd.user.units’ and ‘systemd.user.services’, you can specify
units used by per-user systemd instances.  For example,

  systemd.user.services.foo =
    { description = "foo";
      wantedBy = [ "default.target" ];
      serviceConfig.ExecStart = "${pkgs.foo}/bin/foo";
    };

declares a unit ‘foo.service’ that gets started automatically when the
user systemd instance starts, and is stopped when the user systemd
instance stops.

Note that there is at most one systemd instance per user: it's created
when a user logs in and there is no systemd instance for that user
yet, and it's removed when the user fully logs out (i.e. has no
sessions anymore). So if you're simultaneously logged in via X11 and a
virtual console, you get only one copy of foo.
2014-04-18 00:38:40 +02:00
Eelco Dolstra
073351a5cf Refactor unit option declarations
This gets rid of some duplication.
2014-04-17 23:35:05 +02:00
Eelco Dolstra
2ad6933a22 Remove special handling of systemd-journal-gatewayd 2014-04-17 19:05:29 +02:00
Eelco Dolstra
179acfb664 Allow upstream systemd units to be extended
If you define a unit, and either systemd or a package in
systemd.packages already provides that unit, then we now generate a
file /etc/systemd/system/<unit>.d/overrides.conf. This makes it
possible to use upstream units, while allowing them to be customised
from the NixOS configuration. For instance, the module nix-daemon.nix
now uses the units provided by the Nix package. And all unit
definitions that duplicated upstream systemd units are finally gone.

This makes the baseUnit option unnecessary, so I've removed it.
2014-04-17 18:52:31 +02:00
Eelco Dolstra
560a1103ad Add option ‘systemd.tmpfiles.rules’
This allows specifying rules for systemd-tmpfiles.

Also, enable systemd-tmpfiles-clean.timer so that stuff is cleaned up
automatically 15 minutes after boot and every day, *if* you have the
appropriate cleanup rules (which we don't have by default).
2014-04-17 16:14:56 +02:00
Eelco Dolstra
bb9304e280 Remove creation of /tmp/.ICE-unix
This is now done by tmpfiles.
2014-04-17 16:14:56 +02:00