Commit graph

147 commits

Author SHA1 Message Date
Marc Weber 9bf073b58b s/boot.grubDevice/boot.loader.grub.device/ to shut down warnings 2013-04-10 23:54:37 +02:00
Eelco Dolstra 86f11dadaa switch-to-configuration: Use full path to sync 2013-04-08 17:34:14 +02:00
Eelco Dolstra fbde5e027e Sync after installing the boot loader
Previously we synced just before calling switch-to-configuration.
That prevents corruption of the Nix store, but it can leave the boot
loader configuration and kernel files in /boot corrupted.  So do the
sync after installing the boot loader.
2013-03-28 16:11:54 +01:00
Eelco Dolstra 9000fd81d5 Hack: force timers.target to be started
Usually timers.target is pulled in by basic.target, but we don't
restart basic.target.  So timers.target wouldn't be started when
coming from an older systemd.
2013-03-28 15:02:11 +01:00
Peter Simons c5ba924143 Revert "Add /run/nss to LD_LIBRARY_PATH".
Commit c948494342 exports too many shared
objects into the LD_LIBRARY_PATH, which causes problems with mplayer.
2013-03-21 11:25:25 +01:00
Rickard Nilsson c948494342 Add /run/nss to LD_LIBRARY_PATH
This fixes issues with glibc-binaries (getent for example) that can't
find NSS modules that are not distributed with glibc.

See this discussion:
http://comments.gmane.org/gmane.linux.distributions.nixos/9940
2013-03-07 16:54:42 +01:00
Eelco Dolstra 18e8724e64 Log the configuration when booting / switching 2013-02-18 15:39:47 +01:00
Rickard Nilsson 8fe8ab7097 switch-to-configuration.pl: Fix parsing of comments in fstab, hash-tokens inside strings are not comments. 2013-01-25 15:54:45 +01:00
Rickard Nilsson e32e501435 activation: Don't use double quotes in boot loader warning message, it messes up perl system call 2013-01-25 15:47:38 +01:00
Eelco Dolstra 4d983d4955 Rename ‘system.build.systemd’ to ‘systemd.package’
This makes it cheaper to test a new systemd and is more consistent
with other modules.
2013-01-16 13:17:57 +01:00
Eelco Dolstra 827e3dadc8 Don't special-case systemd-journald.service and systemd-user-sessions.service 2013-01-08 17:00:45 +01:00
Eelco Dolstra 1541311f06 switch-to-configuration: Stop some target units to ensure proper dependency ordering
This is currently only done for network-interfaces.target, but
it should propably be done for most targets.
2013-01-07 16:06:45 +01:00
Eelco Dolstra 96ba0ca283 For some units, use "systemctl restart" rather than "systemctl stop/start"
During a configuration switch, changed units are stopped in the old
configuration, then started in the new configuration (i.e. after
running the activation script and running "systemctl daemon-reload").
This ensures that services are stopped using the ExecStop/ExecStopPost
commands from the old configuration.

However, for some services it's undesirable to stop them; in
particular dhcpcd, which deconfigures its network interfaces when it
stops.  This is dangerous when doing remote upgrades - usually things
go right (especially because the switch script ignores SIGHUP), but
not always (see 9aa69885f0).  Likewise,
sshd should be kept running for as long as possible to prevent a
lock-out if the switch fails.

So the new option ‘stopIfChanged = false’ causes "systemctl restart"
to be used instead of "systemctl stop" followed by "systemctl start".
This is only proper for services that don't have stop commands.  (And
it might not handle dependencies properly in some cases, but I'm not
sure.)
2013-01-05 01:05:25 +01:00
Eelco Dolstra 9aa69885f0 Don't do readlink() on every mount point when remounting /dev etc.
Doing so causes the activation script to hang if (say) an NFS mount
point is unreachable.
2013-01-02 18:28:44 +01:00
Eelco Dolstra b3c5d42b1d Don't create /var/log/upstart 2012-10-26 16:22:18 +02:00
Eelco Dolstra 06cbe62537 switch-to-configuration: Support services activated by multiple sockets 2012-10-18 13:26:47 -04:00
Eelco Dolstra 10ac80115b switch-to-configuration: Fix bad Perl 2012-10-14 21:12:11 -04:00
Eelco Dolstra fd7dbc99ab switch-to-configuration: Handle multiple swap devices properly 2012-10-12 16:37:14 -04:00
Eelco Dolstra 6b185a131f Use config.system.build.systemd in the toplevel derivation 2012-10-10 16:49:59 -04:00
Eelco Dolstra 4fa9b4b257 Restart systemd if necessary 2012-09-21 14:58:28 -04:00
Eelco Dolstra 8adc1ee92e switch-to-configuration: Stop sockets corresponding to services
If a service has a corresponding socket unit, then stop the socket
before stopping the service.  This prevents it from being restarted
behind our backs.  Also, don't restart the service; it will be
restarted on demand via the socket.
2012-08-23 12:12:58 -04:00
Eelco Dolstra dfb6e891b9 switch-to-configuration: Don't restart systemd-user-sessions.service
Restarting it causes all user sessions to be killed.
2012-08-23 11:11:14 -04:00
Eelco Dolstra af550048e8 switch-to-configuration: Don't restart the suspend/hibernate targets
Restarting them has the side effect of suspending/hibernating the
system again.
2012-08-23 11:11:04 -04:00
Eelco Dolstra f3def8194e switch-to-configuration: Restart all active targets 2012-08-20 16:19:03 -04:00
Eelco Dolstra 3f4ffffed7 Fix a Perl warning 2012-08-20 11:32:50 -04:00
Eelco Dolstra 08f14b33c1 Merge branch 'master' of github.com:NixOS/nixos into systemd 2012-08-20 11:27:38 -04:00
Eelco Dolstra a44e575196 switch-to-configuration: Respect the ‘restartIfChanged’ attribute 2012-08-17 13:14:42 -04:00
Eelco Dolstra a4a90685ea switch-to-configuration: Handle swap devices 2012-08-10 15:52:47 -04:00
Eelco Dolstra a3c75462c1 switch-to-configuration: Handle switching all systemd units 2012-08-10 15:15:59 -04:00
Eelco Dolstra ce7ead7bd7 switch-to-configuration: Handle changes to fileSystems
We now automatically remount filesystems with changed options, mount
new filesystems, and unmount obsolete filesystems.
2012-08-10 10:56:55 -04:00
Eelco Dolstra f31ab09b85 Set uniq type on boot.loader.kernelFile 2012-08-09 11:00:35 -04:00
Eelco Dolstra d33fd9a1f8 switch-to-configuration: Assume that services that are auto-restarting are going to fail 2012-08-06 15:48:46 -04:00
Eelco Dolstra 2a91bb5282 switch-to-configuration: Print new units 2012-08-03 17:13:34 -04:00
Eelco Dolstra 320682a558 switch-to-configuration: Don't ellipsize log output 2012-08-03 14:39:59 -04:00
Eelco Dolstra 0d6b96a525 switch-to-configuration: Fix the call to install the boot loader 2012-08-03 14:07:43 -04:00
Eelco Dolstra aa6fd9f8a2 switch-to-configuration: Handle unit template instances 2012-08-03 13:47:59 -04:00
Eelco Dolstra bd3c9febc9 switch-to-configuration: Stop units in one call to systemctl 2012-08-03 13:29:56 -04:00
Eelco Dolstra b6bd0a4f84 switch-to-configuration: Restart services that were manually started 2012-08-03 11:53:14 -04:00
Eelco Dolstra 56ce5614f9 switch-to-configuration: Print all failed services 2012-08-03 10:40:01 -04:00
Eelco Dolstra 4d2deff7af Stop obsolete units, restart changed units, start new units 2012-08-02 17:26:23 -04:00
Eelco Dolstra 0fc68a3d1d Rewrite switch-to-configuration in Perl
This will make it more efficient to do systemd dependency graph
processing (if necessary).
2012-08-02 15:11:29 -04:00
Eelco Dolstra d4fec178fd Merge remote-tracking branch 'origin/master' into systemd 2012-08-02 13:44:16 -04:00
Eelco Dolstra 6576d81ff1 Fix "please: command not found" in switch-to-configuration 2012-07-30 15:19:30 -04:00
Eelco Dolstra b52117c34d Treat init-script as a boot loader 2012-07-25 11:30:16 -04:00
Eelco Dolstra b15e1fbb08 Boot loader refactoring
- Renamed system.build.menuBuilder to system.build.installBootLoader.

- ‘install-grub.pl’ (formerly grub-menu-builder.pl) now generates the
  GRUB menu *and* installs GRUB (if necessary).

- ‘switch-to-configuration.sh’ has no boot loader specific knowledge
  anymore.  It just calls installBootLoader.
2012-07-25 10:47:32 -04:00
Eelco Dolstra f0c82f4543 Pass the ‘--recheck’ flag to grub-install 2012-07-24 19:22:19 -04:00
Eelco Dolstra f07f221f0e Replace grub-menu-builder with a much faster version
The old GRUB menu builder script is quite slow, typically taking
several seconds.  This is a real annoyance since it's run every time
you switch to a new configuration.  Therefore this patch replaces the
Bash script with a much faster Perl script.  In a VirtualBox test, the
execution time went from 2.7s to 0.1s.  The Perl version is also more
correct because it uses XML to get the GRUB configuration (through
builtins.toXML), so there are no shell escaping issues.

The new script currently lacks support for subconfigurations defined
through "nesting.children".
2012-07-24 19:16:27 -04:00
Eelco Dolstra 0edf138fc7 switch-to-configuration: Initial systemd support
It reloads the configuration, but doesn't (re)start jobs yet.
2012-07-20 18:25:36 -04:00
Eelco Dolstra 0b865edb16 switch-to-configuration: require a reboot going from Upstart to systemd 2012-07-20 16:23:52 -04:00
Eelco Dolstra 44d091674b Merge branch 'master' of github.com:NixOS/nixos into systemd
Conflicts:
	modules/config/networking.nix
	modules/services/networking/ssh/sshd.nix
	modules/services/ttys/agetty.nix
	modules/system/boot/stage-2-init.sh
	modules/system/upstart-events/shutdown.nix
2012-07-16 17:27:11 -04:00