Commit Graph

3863 Commits

Author SHA1 Message Date
Langston Barrett
44b1d6bff3 mopidy service: add default value for configuration (#17385)
Mopidy will start if the configuration is empty.

Fixes #17381.
(cherry picked from commit a28273df32)
2016-08-01 14:54:32 +02:00
Rob Vermaas
1425a1f964 dd-agent: support jmx, needs a separate daemon nowadays. 2016-07-29 12:41:35 +00:00
Bjørn Forsman
b9fa0cf83c nixos/ddclient: add warning about password being world readable
Closes #16885.

(cherry picked from commit 78eac466b0)
2016-07-19 16:53:11 +02:00
Matthew Justin Bauer
ebb204732e virtualbox: fix virtualbox guest additions (#16964)
(cherry picked from commit 802a700373)
2016-07-19 13:56:37 +02:00
Bjørn Forsman
00dfa5b4e5 nixos/systemd: disable timer units with service
A disabled systemd service with a "startAt" attribute, like this:

  systemd.services.foo-service = {
    enable = false;
    startAt = "*-*-* 05:15:00";
    ...
  };

will cause the following errors in the system journal:

  systemd[1]: foo-service.timer: Refusing to start, unit to trigger not loaded.
  systemd[1]: Failed to start foo-service.timer.

Fix it by not generating the corresponding timer unit when the service
is disabled.

(cherry picked from commit 2eb8aab42c)
2016-07-16 09:41:52 +02:00
Bjørn Forsman
bd1d9ffa91 nixos/swap: support for resizing swapfile
Currently NixOS creates the swapfile (with the specified size) only if
it doesn't already exist. Changing the swapfile size afterwards will not
have any effect.

This commit changes that so the swapfile will be recreated whenever
swapDevices.*.size is changed (or more precisely, whenever the actual
file size differs from the configured one), allowing both growing and
shrinking the swapfile.

The service unit has "restartIfChanged = false", so we don't have to
worry about the swapfile being in use at the time this code is run (you
have to reboot for swapfile changes).

fallocate doesn't shrink files, use truncate for that. truncate can also
be used to grow files, but it creates "holes" in the file which doesn't
work with swapfiles.

(cherry picked from commit b30852ed41)
2016-07-16 09:41:52 +02:00
Bjørn Forsman
08f4bc4c34 nixos/grub: change state file device separator from ':' to ','
':' is currently used as separator in /boot/grub/state for the list of
devices GRUB should be installed to. The problem is that ':' itself may
appear in a device path:

  /dev/disk/by-id/usb-SanDisk_Cruzer_20043512300546C0B317-0:0

With such a path, NixOS will install GRUB *every* time, because it
thinks the configuration differs from the state file (due to the wrong
list split). Fix it by using ',' as separator.

For existing systems with GRUB installed on multiple devices, this
change means that GRUB will be installed one extra time.

(cherry picked from commit aeb516c741)
2016-07-16 09:41:52 +02:00
Bjørn Forsman
bd66409a01 switch-to-configuration: use absolute path to systemd-escape
Fixes issue when upgrading from very old NixOS systems that don't have
systemd-escape in $PATH:

  $ sudo nixos-rebuild switch
  ...
  building the system configuration...
  updating GRUB 2 menu...
  Can't exec "systemd-escape": No such file or directory at /nix/var/nix/profiles/system/bin/switch-to-configuration line 264.
  Unable to escape /!

(cherry picked from commit 9050077cff)
2016-07-15 13:40:03 +02:00
Eelco Dolstra
f0210311aa Update 16.03 AMIs
(cherry picked from commit 9aa3e78ab2)
2016-07-13 10:40:29 +02:00
Eelco Dolstra
ab4e3c7b80 amazon-image.nix: Add the ena driver
This is necessary for Enhanced Networking on x1.* instances.

(cherry picked from commit 56badfee94)
2016-07-11 15:17:44 +02:00
Eelco Dolstra
0229827a15 amazon-image.nix: Add the ixgbevf driver
(cherry picked from commit 3adb769776)
2016-07-11 15:17:44 +02:00
Robert Helgesson
16e753e54d ddclient service: use environment.etc
The ddclient daemon requires that the configuration file is only
accessible by the ddclient user. This since it typically contains login
information.

(cherry picked from commit 9f4775dbb5)
2016-07-09 14:56:28 +02:00
roblabla
466e7feece matrix-synapse: update 0.12.0 -> 0.16.1-r1
Fixes critical security issue:

  https://matrix.org/blog/2016/07/08/critical-security-vulnerability-in-synapse-0-12-to-0-16-1-inclusive/

See #16798.

(cherry picked from commit be21e16652)
(cherry picked from commit 091a911bcd)
(cherry picked from commit 26da79230b)
(cherry picked from commit 65005fe302)
(cherry picked from commit f77af9aa5e)
2016-07-09 03:45:40 +02:00
Anders Lundstedt
6320299e16 nixos: fix avahi connectivity for shairport-sync module
The shairport-sync service currently fails to start with the error

shairport avahi_entry_group_new failed

This problem seems to have been introduced by

cdd7310a50

After some trial and error I concluded that the attached commit is a minimal
fix.

(cherry picked from commit 5f3c4bd11e)
2016-07-08 18:11:48 +02:00
Al Zohali
057421e8e2 nix.requireSignedBinaryCaches: description fix
(cherry picked from commit a227bd4e3b)

[Bjørn: The description says the default is "disabled" (wrong).]
2016-07-05 13:11:13 +02:00
Rickard Nilsson
3f49faa6aa nixos/libvirtd: Don't use the --daemon flag now that we use the 'notify' service type
(cherry picked from commit 7d67a4da99)
2016-07-01 19:10:21 +02:00
Rickard Nilsson
462d3747b1 nixos/elasticsearch: Set a group on the user
This fixed a problem I had when running ElasticSearch in an LXC
container, and it doesn't hurt using a dedicated group instead of
nogroup anyway.

(cherry picked from commit 9facb7078b)
2016-07-01 19:10:16 +02:00
Rickard Nilsson
adc5760bb2 nixos/libvirt: Syntactic-only refactoring
(cherry picked from commit a0c0f63811)
2016-07-01 19:09:56 +02:00
Rickard Nilsson
bb52e1449d nixos/libvirt: Add virtlogd and virtlockd systemd sockets and services
(cherry picked from commit 301b4e9018)
2016-07-01 19:09:48 +02:00
Rickard Nilsson
b9397df732 nixos/libvirt: Adapt libvirtd.service to upstream sources
(cherry picked from commit 1b54e48561)
2016-07-01 19:09:44 +02:00
Rickard Nilsson
0a16a4e5b1 nixos/libvirt: Remove non-functional service libvirt-guests
It doesn't have a start script, so it hasn't worked at all in
a long time.

(cherry picked from commit 37f4889851)
2016-07-01 19:09:17 +02:00
Bjørn Forsman
b5a905beac nixos/update-users-groups.pl: print UIDs and GIDs
Instead of showing this output from "nixos-rebuild switch":

  warning: not applying GID change of group ‘munin’
  warning: not applying UID change of user ‘ntp’

print this:

  warning: not applying GID change of group ‘munin’ (95 -> 102)
  warning: not applying UID change of user ‘ntp’ (3 -> 179)

This makes it possible for users to take action and fixup the UIDs/GIDs
that NixOS won't touch.

(cherry picked from commit 6e528893a8)
2016-07-01 14:23:32 +02:00
Bjørn Forsman
7bcd427ca9 nixos/gnome-desktop: enable colord service
Fixes this (line wrapped):

  $ gnome-control-center
  [... click on the "Color" item ...]
  (gnome-control-center:3977): color-cc-panel-WARNING **: \
    The name org.freedesktop.ColorManager was not provided by any .service files

With this patch applied, the above warnings are not printed and the GUI
shows some devices that can be managed (my printer and display). Without
this patch the GUI is empty (non-functional).

(cups will also complain in the journal with a similar message when
doing print jobs, without this patch.)

(cherry picked from commit 66ee7a4c46)
2016-07-01 07:34:40 +02:00
Nikolay Amiantov
be4e63004f colord service: init
(cherry picked from commit 4e58b33dee)

[Bjørn: Add ./services/x11/colord.nix to module-list.nix, was missing in
the above commit. (It was added as part of 776845bbeb
("xiccd: init at 0.2.2") though.)
]
2016-07-01 07:34:19 +02:00
Nikolay Amiantov
fcd0923564 nixos-install: fix SSL certificate error
(cherry picked from commit 1193790b95)
2016-06-24 19:18:34 +03:00
Bjørn Forsman
5c8d9bacd0 nixos/gnome-desktop: fix adding printers with GNOME Control Center
...by adding system-config-printer to services.dbus.packages (if
services.printing.enable is true).

Without this patch, trying to add a printer will result in a little dialog
saying "Failed to add new printer" and gnome-control-center will print this to
the terminal (line wrapped):

(gnome-control-center:3546): printers-cc-panel-WARNING **: \
  GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: \
  The name org.fedoraproject.Config.Printing was not provided by any .service files

system-config-printer supplies the "org.fedoraproject.Config.Printing" dbus
service, thus fixing the problem.

(cherry picked from commit a156a8ab1a)
2016-06-22 14:23:07 +02:00
Sander van der Burg
af412f29c8 disnix-module: split dysnomia's functionality into a separate module so that it can be used without Disnix and remove the hacky/obsolete avahi publisher
(cherry picked from commit 8fccaa9011)
2016-06-17 09:26:20 +00:00
Eelco Dolstra
3111985677 Explicitly specify the subsystem for /dev/vboxguest
Otherwise systemd gets confused and forgets about device units after
reloading.

https://github.com/NixOS/nixops/issues/391
https://github.com/systemd/systemd/issues/3423
(cherry picked from commit 7c19b395eb)
2016-06-03 00:43:50 +02:00
Eelco Dolstra
a4c9f82bdc nixos-generate-config: Enable strictness
(cherry picked from commit c6ab4ab206)
2016-05-27 13:41:09 +02:00
Eelco Dolstra
4701211bf8 Fix failure to start old containers
The existence of $root/var/lib/private/host-notify as a socket
prevented a bind mount:

  container foo[8083]: Failed to create mount point /var/lib/containers/foo/var/lib/private/host-notify: No such device or address

(cherry picked from commit b37d6d8996)
2016-05-27 13:40:50 +02:00
Eelco Dolstra
0559af6262 KDE test: Bump kdm start timeout
Hopefully this will fix random failures like
http://hydra.nixos.org/build/36249079.

(cherry picked from commit b786b00023)
2016-05-27 13:39:56 +02:00
Eelco Dolstra
18e067ac80 xf86-video-modesetting: Remove
This driver is part of xorg-server now, so we were using an outdated
version.

(cherry picked from commit c7d92f9485)
2016-05-24 15:34:30 +02:00
Taeradan
34a7a5ce98
fail2ban service: add iproute to PATH
iproute is required for blocking via null routes; without it, rules
based on routes.conf will fail.

Closes #15638

(cherry picked from commit 77028b1e8d)
2016-05-23 22:38:53 +02:00
Domen Kožar
91cc776f0a setuid-wrappers: remove config.system.path from the closure
The motivation is using sudo in chroot nix builds, a somewhat
special edge case I have and pulling system path into chroot
yields to some very nasty bug like
https://github.com/NixOS/nixpkgs/issues/15581

Previously:

$ cat /var/setuid-wrappers/sudo.real
/nix/store/3sm04dzh0994r86xqxy52jjc0lqnkn65-system-path/bin/sudo

After the change:

$ cat /var/setuid-wrappers/sudo.real
/nix/store/4g9sxbzy8maxf1v217ikp69c0c3q12as-sudo-1.8.15/bin/sudo
2016-05-23 13:50:50 +01:00
Arnold Krille
0b0f759b93 unbound service: do not initialize root cert
When enableRootTrustAnchor is set to false, there is really no point in
initializing the root key before starting unbound.

Fixes #15605.

(cherry picked from commit bf0e745597)
2016-05-21 22:27:55 +02:00
Domen Kožar
9ea8f6ad7d command-not-found: disable module until it's fixed again
See https://github.com/NixOS/nixos-channel-scripts/issues/4

(cherry picked from commit 2a3c0ca3d5)
Signed-off-by: Domen Kožar <domen@dev.si>
2016-05-19 20:17:02 +01:00
Joachim Fasting
5f6dbe1a5a
grsecurity: add option to disable chroot caps restriction
The chroot caps restriction disallows chroot'ed processes from running
any command that requires `CAP_SYS_ADMIN`, breaking `nixos-rebuild`. See
e.g., https://github.com/NixOS/nixpkgs/issues/15293

This significantly weakens chroot protections, but to break
nixos-rebuild out of the box is too severe.

(cherry picked from commit d4d7bfe07b)
2016-05-15 11:06:50 +02:00
Joachim Fasting
e8faaf0996
grsecurity module: fix grsec-lock unit ordering
Requirement without ordering implies parallel execution; it is crucial
that sysctl tunables are finalized before the lock is engaged, however.

(cherry picked from commit 60a27781d6)
2016-05-15 11:05:16 +02:00
Shea Levy
1906eb9cd5 Add kerberos mappings for MIT exchange server
(cherry picked from commit 67d430096f)
2016-05-11 09:09:34 -04:00
Eelco Dolstra
7efca53da4 Update EC2 AMIs to 16.03.659.011ea84
This includes the binutils mass rebuild.

(cherry picked from commit ecfc523d32)
2016-05-09 19:39:12 +02:00
Lluís Batlle i Rossell
165781b529 Fixing nfsd service, wait on local-fs.
Otherwise, mountd was started exporting directories before local-fs was ready,
and it failed to start nfsd on missing fs.

(cherry picked from commit 9f6afb7d78)
2016-05-09 14:26:49 +02:00
aszlig
cc98c4e105
nixos/stage-1: Don't kill kernel threads
Unfortunately, pkill doesn't distinguish between kernel and user space
processes, so we need to make sure we don't accidentally kill kernel
threads.

Normally, a kernel thread ignores all signals, but there are a few that
do. A quick grep on the kernel source tree (as of kernel 4.6.0) shows
the following source files which use allow_signal():

  drivers/isdn/mISDN/l1oip_core.c
  drivers/md/md.c
  drivers/misc/mic/cosm/cosm_scif_server.c
  drivers/misc/mic/cosm_client/cosm_scif_client.c
  drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
  drivers/staging/rtl8188eu/core/rtw_cmd.c
  drivers/staging/rtl8712/rtl8712_cmd.c
  drivers/target/iscsi/iscsi_target.c
  drivers/target/iscsi/iscsi_target_login.c
  drivers/target/iscsi/iscsi_target_nego.c
  drivers/usb/atm/usbatm.c
  drivers/usb/gadget/function/f_mass_storage.c
  fs/jffs2/background.c
  fs/lockd/clntlock.c
  fs/lockd/svc.c
  fs/nfs/nfs4state.c
  fs/nfsd/nfssvc.c

While not all of these are necessarily kthreads and some functionality
may still be unimpeded, it's still quite harmful and can cause
unexpected side-effects, especially because some of these kthreads are
storage-related (which we obviously don't want to kill during bootup).

During discussion at #15226, @dezgeg suggested the following
implementation:

for pid in $(pgrep -v -f '@'); do
    if [ "$(cat /proc/$pid/cmdline)" != "" ]; then
        kill -9 "$pid"
    fi
done

This has a few downsides:

 * User space processes which use an empty string in their command line
   won't be killed.
 * It results in errors during bootup because some shell-related
   processes are already terminated (maybe it's pgrep itself, haven't
   checked).
 * The @ is searched within the full command line, not just at the
   beginning of the string. Of course, we already had this until now, so
   it's not a problem of his implementation.

I posted an alternative implementation which doesn't suffer from the
first point, but even that one wasn't sufficient:

for pid in $(pgrep -v -f '^@'); do
    readlink "/proc/$pid/exe" &> /dev/null || continue
    echo "$pid"
done | xargs kill -9

This one spawns a subshell, which would be included in the processes to
kill and actually kills itself during the process.

So what we have now is even checking whether the shell process itself is
in the list to kill and avoids killing it just to be sure.

Also, we don't spawn a subshell anymore and use /proc/$pid/exe to
distinguish between user space and kernel processes like in the comments
of the following StackOverflow answer:

http://stackoverflow.com/a/12231039

We don't need to take care of terminating processes, because what we
actually want IS to terminate the processes.

The only point where this (and any previous) approach falls short if we
have processes that act like fork bombs, because they might spawn
additional processes between the pgrep and the killing. We can only
address this with process/control groups and this still won't save us
because the root user can escape from that as well.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Fixes: #15226
2016-05-06 22:06:34 +02:00
Franz Pletz
82ca7f75d6 redshift service: run as user service
Fixes #14882.

(cherry picked from commit 882391a162)
Signed-off-by: Domen Kožar <domen@dev.si>
2016-05-03 22:33:27 +01:00
Bjørn Forsman
45156b4057 jenkins service: improve curl call in postStart
* Perform HTTP HEAD request instead of full GET (lighter weight)
* Don't log output of curl to the journal (it's noise/debug)
* Use explicit http:// URL scheme
* Reduce poll interval from 10s to 2s (respond to state changes
  quicker). Probably not relevant on boot (lots of services compete for
  the CPU), but online service restarts/reloads should be quicker.
* Pass --fail to curl (should be more robust against false positives)
* Use 4 space indent for shell code.

(cherry picked from commit 78b6e8c319)
2016-05-03 23:19:16 +02:00
Bjørn Forsman
b786bfd8a3 jenkins service: remove unneeded (and brittle) part of postStart
The current postStart code holds Jenkins off the "started" state until
Jenkins becomes idle. But it should be enough to wait until Jenkins
start handling HTTP requests to consider it "started".

More reasons why the current approach is bad and we should remove it,
from @coreyoconnor in
https://github.com/NixOS/nixpkgs/issues/14991#issuecomment-216572571:

  1. Repeatedly curling for a specific human-readable string to
  determine "Active" is fragile. For instance, what happens when jenkins
  is localized?

  2. The time jenkins takes to initializes is variable. This (at least
  used to) depend on the number of jobs and any plugin upgrades requested.

  3. Jenkins can be requested to restart from the UI. Which will not
  affect the status of the service. This means that the service being
  "active" does not imply jenkins is initialized. Downstream services
  cannot assume jenkins is initialized if the service is active. Might
  as well accept that and remove the initialized test from service
  startup.

Fixes #14991.

(cherry picked from commit 51e5beca42)
2016-05-03 23:18:49 +02:00
Eelco Dolstra
a240110dc8 acme.nix: Fix unit descriptions
Unit descriptions should be capitalized, and timer units don't have
to describe that they're timers.

(cherry picked from commit 0c5e837b66)
2016-04-28 13:59:17 +02:00
Bjørn Forsman
0170599d55 jenkins service: bring back $SSL_CERT_FILE
A continuation of commit 23489b34c0
("Bring back $SSL_CERT_FILE"). Quoting that commit message:

  Commit 9f358f809d removed
  $SSL_CERT_FILE, which is fine for binaries linking against the current
  OpenSSL package, but not old binaries (e.g. those installed via
  nix-env). So let's keep $SSL_CERT_FILE for a while longer.

The above patch is only applied to 'release-16.03', so do the same for
this one.
2016-04-27 20:34:00 +02:00
David Guibert
0c12babcfd
kerberos_server: fix evaluation (closes #14928)
(cherry picked from commit 23e3cbeca4)
2016-04-25 16:05:45 +02:00
Graham Christensen
b6c51f3e79 facetimehd: Only unload module if it is loaded
The pre-sleep service exits if any command fails. Unloading facetimehd
without it being loaded blocks subsequent commands from running.

Note: `modprobe -r` works a bit better when unloading unused modules,
and is preferrable to `rmmod`. However, the facetimehd module does not
support suspending. In this case, it seems preferable to forcefully
unload the module. `modprobe` does not support a `--force` flag when
removing, so we are left with `rmmod`.

See:
 - https://github.com/NixOS/nixpkgs/pull/14883
 - https://github.com/patjak/bcwc_pcie/wiki#known-issues
2016-04-23 11:59:00 -05:00
Tuomas Tynkkynen
37ad310ceb qemu-img: Fix module paths
They are compressed nowadays.

Not sure if these are really needed since nobody noticed they were
broken, but anyway...
2016-04-23 11:54:54 -05:00