Commit Graph

4432 Commits

Author SHA1 Message Date
aszlig
6228949157
nixos/tests/boot-stage1: Add myself to maintainers
As @edolstra pointed out that the kernel module might be painful to
maintain. I strongly disagree because it's only a small module and it's
good to have such a canary in the tests no matter how the bootup process
looks like, so I'm going the masochistic route and try to maintain it.

If it *really* becomes too much maintenance burden, we can still drop or
disable kcanary.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2016-05-06 22:06:34 +02:00
aszlig
43da2f3209
nixos/release-combined: Add boot-stage1 test
We don't want to push out a channel update whenever this test fails,
because that might have unexpected and confused side effects and it
*really* means that stage 1 of our boot up is broken.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2016-05-06 22:06:34 +02:00
aszlig
45b7d41fa7
nixos/tests: Add a test for boot stage 1
We already have a small regression test for #15226 within the swraid
installer test. Unfortunately, we only check there whether the md
kthread got signalled but not whether other rampaging processes are
still alive that *should* have been killed.

So in order to do this we provide multiple canary processes which are
checked after the system has booted up:

 * canary1: It's a simple forking daemon which just sleeps until it's
            going to be killed. Of course we expect this process to not
            be alive anymore after boot up.
 * canary2: Similar to canary1, but tries to mimick a kthread to make
            sure that it's going to be properly killed at the end of
            stage 1.
 * canary3: Like canary2, but this time using a @ in front of its
            command name to actually prevent it from being killed.
 * kcanary: This one is a real kthread and it runs until killed, which
            shouldn't be the case.

Tested with and without 67223ee and everything works as expected, at
least on my machine.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2016-05-06 22:06:34 +02:00
aszlig
74b41a7385
nixos/tests/installer/swraid: Check for safemode
This is a regression test for #15226, so that the test will fail once we
accidentally kill one or more of the md kthreads (aka: if safe mode is
enabled).

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2016-05-06 22:06:34 +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
Tuomas Tynkkynen
809a13010a treewide: Replace module_init_tools -> kmod
The former is deprecated and doesn't handle compressed kernel modules,
so all current usages of it are broken.

(cherry picked from commit 01854a850a)
2016-04-23 11:54:34 -05:00
Joachim Fasting
5740226f88
Revert "Merge pull request #14926 from grahamc/graceful-facetimehd-module-unload-16.03"
This reverts commit 71916459a3, reversing
changes made to 9d1662c6c9.

I noticed too late that this does not use kmod, like its counterpart on master.
See https://github.com/NixOS/nixpkgs/issues/14885
2016-04-23 18:24:18 +02:00
Graham Christensen
52ecfe2da2 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 09:31:40 -05:00
Domen Kožar
9d1662c6c9 make all boot tests release critical #14902 2016-04-23 13:12:17 +01:00
Ricardo M. Correia
e45ea6ddb7 nixos.locate: fix update-locatedb service failure
It was failing with a `Read-only filesystem` failure due to the systemd
service option `ReadWriteDirectories` not being correctly configured.

Fixes #14132

(cherry picked from commit f5951c55f7)
2016-04-14 15:38:53 +02:00
Eelco Dolstra
f21658dfca Add a regression test for #14623
(cherry picked from commit a42698d2a4)
2016-04-14 13:20:32 +02:00
Eelco Dolstra
b6de72513f Fix X11 tests broken by the removal of -ac
Probably missed a few. Also adding xauth to the system path (it was
already in the closure).

(cherry picked from commit 9153d8ed64)
2016-04-14 13:20:25 +02:00
Eelco Dolstra
659c41a7d5 X server: Enable local access control
For the last ten years we have been passing -ac to the X server, which
is very bad idea.

Fixes #14623.

(cherry picked from commit 1541fa351b)
2016-04-14 13:20:22 +02:00
Eelco Dolstra
e0f77f7217 Restore default core limit of 0:infinity
Continuation of 79c3c16dcb. Systemd 229
sets the default RLIMIT_CORE to infinity, causing systems to be
littered with core dumps when systemd.coredump.enable is disabled.

This restores the 15.09 soft limit of 0 and hard limit of infinity.

(cherry picked from commit 840f3230a2)
2016-04-14 13:19:25 +02:00
Joachim Fasting
027e666b34 Revert "Merge pull request #14262 from peterhoeg/flexget"
This reverts commit c8b6c37792, reversing
changes made to 91a3e47895.

Sorry, I did not notice that this was opened against the wrong branch ...
2016-04-13 02:53:28 +02:00
joachifm
c8b6c37792 Merge pull request #14262 from peterhoeg/flexget
flexget: create nixos service module
2016-04-13 02:44:37 +02:00
Vladimír Čunát
4ffe3f9593 nixos-generate-config: lower priority of nix.maxJobs
Fixes #6429.

(cherry picked from commit 5c04313451)
2016-04-12 08:10:31 +02:00
Joachim Fasting
97f6277819 manual: delete dangling pointer to real-world NixOS configs
At some point we probably want to replace this with a curated list
of configurations or even an upstreamed repository of examples, but
for now this is just noise.

Fixes NixOS/nixpkgs#14522

(cherry picked from commit 678e1955b1)
2016-04-09 18:17:18 +02:00
Eelco Dolstra
aef0efc389 httpd.service: Support reload
This is useful when ACME has generated a new TLS certificate.

(cherry picked from commit 133e6e1ea6)
2016-04-08 19:42:15 +02:00
Lluís Batlle i Rossell
516f47efef Making trac/ldap handle httpd 2.4.
The option authzldapauthoritative had been removed in 2.4
2016-04-07 11:38:06 +02:00
Eelco Dolstra
cbeef98664 Add 16.03 AMIs
(cherry picked from commit ab2855b975)
2016-04-06 18:43:57 +02:00
Eelco Dolstra
b2ca64f52b Move the EC2 AMI registry from the NixOps repo
NixOps has infrequent releases, so it's not the best place for keeping
the list of current AMIs. Putting them in Nixpkgs means that AMI
updates will be delivered as part of the NixOS channels.

(cherry picked from commit 4e356cefd7)
2016-04-06 18:43:14 +02:00
Eelco Dolstra
a550dcac7f Update AMI creation script
(cherry picked from commit 69c746d06b)
2016-04-06 18:40:53 +02:00
Domen Kožar
567b65d165 nixos tests: increase timeout for udevadm settle, see #13559 2016-04-06 12:56:51 +01:00
Roger Qiu
8777eb989a nixos/stage-1: Removed logCommands conditional for resetting the file descriptors after completion of logging
(cherry picked from commit 53e8e93939)
2016-04-05 23:55:59 +02:00
Nikolay Amiantov
a5d3fdc726 dspam service: run after postgresql to prevent segfaults
(cherry picked from commit ea5c7d553c)
2016-04-05 18:01:49 +03:00
Nikolay Amiantov
b2be13433d uwsgi service: use python.buildEnv, fix PATH
(cherry picked from commit 25754a5fc2)
2016-04-05 17:58:47 +03:00
Eelco Dolstra
ad0b2cfb7c Revert "initrd: Use modprobe from busybox"
This reverts commit 45c218f893.

Busybox's modprobe causes numerous "Unknown symbol" errors in the
kernel log, even though the modules do appear to load correctly.
2016-04-04 15:24:01 +02:00
Nicolas B. Pierron
3420ac1b2e Fix typo in service.syncthing.dataDir description.
(cherry picked from commit 411408f74c)
2016-04-04 12:42:06 +02:00
Rastus Vernon
ae4d57f2e7 nixos manual: recommend use of dd for writing the image
Unetbootin works by altering the image and placing a boot loader on it.
For this reason, it cannot work with UEFI and the installation guides
for other distributions (incl. Debian and Fedora) recommend against
using it.

Since dd writes the image verbatim to the drive, and not just the files,
it is not necessary to change the label after using it for UEFI
installations.

vcunat: tiny changes to the PR. Close #14139.
(cherry picked from commit d6998b0674)
2016-04-02 17:43:13 +02:00
Domen Kožar
089a5889ce Merge pull request #14368 from ttuegel/kde5-release-16.03
release-16.03: note KDE 5 upgrades in release notes
2016-04-01 15:19:35 +01:00
Eelco Dolstra
6e90d2f83a ssh: Fix support for ssh-dss host keys
(cherry picked from commit 3fb1708427)
2016-04-01 16:04:15 +02:00
Thomas Tuegel
e90ef1b4c3 release-16.03: note KDE 5 upgrades in release notes 2016-04-01 08:57:21 -05:00
Domen Kožar
ecf6ca477c changelog: correct path to gitit nixos module
(cherry picked from commit d8abfc87c6)
Signed-off-by: Domen Kožar <domen@dev.si>
2016-03-31 23:49:48 +01:00
Domen Kožar
b01eedaeec nixos-generate-config.pl: correct path for broadcom-43xx 2016-03-31 23:46:54 +01:00
makefu
9733045d05 graphite: fix carbonCache graphiteWeb graphiteApi
This commit implements the changes necessary to start up a graphite carbon Cache
with twisted and start the corresponding graphiteWeb service.
Dependencies need to be included via python buildEnv to include all recursive
implicit dependencies.

Additionally cairo is a requirement of graphiteWeb and pycairo is not a standard
python package (buildPythonPackage) and therefore cannot be included via
buildEnv. It also needs cairo in the Library PATH.

(cherry picked from commit 626bfce3b8)
Signed-off-by: Domen Kožar <domen@dev.si>
2016-03-31 23:40:00 +01:00
Domen Kožar
216c840ca8 changelog: note binutils upgrade 2016-03-31 23:39:01 +01:00
Domen Kožar
279557e6d2 changelog: note release date 2016-03-31 23:08:49 +01:00
Domen Kožar
d231868990 changelog: add all new NixOS modules 2016-03-31 23:00:24 +01:00
Eelco Dolstra
65075167ce NixOS manual: Add some release notes
(cherry picked from commit e60be0923b)
Signed-off-by: Domen Kožar <domen@dev.si>
2016-03-31 13:47:12 +01:00
Eelco Dolstra
a2b526d41a Fix the boot-ec2-config test
(cherry picked from commit 1783e33b06)
2016-03-31 13:32:56 +02:00
Pascal Wittmann
daf0729f3a nixos/manpages: enable linebreaking after slashes
Allow linbreaks after slashes in long URLs. The option used
is documented at

   http://docbook.sourceforge.net/release/xsl/current/doc/manpages/man.break.after.slash.html

This commit fixes #4538.

(cherry picked from commit 8ddfab0cf2)
2016-03-31 11:29:05 +02:00