From ccd6f5a3133d5b67f79242f129e1adc901578499 Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Sun, 1 Mar 2015 22:46:56 +0100 Subject: [PATCH] nixos: make the grsec-lock unit depend on the path it writes to The grsec-lock unit fails unless /proc/sys/kernel/grsecurity/grsec_lock exists and so prevents switching into a new configuration after enabling grsecurity.sysctl. --- nixos/modules/security/grsecurity.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/security/grsecurity.nix b/nixos/modules/security/grsecurity.nix index d0c7fa6ec28..8775893f531 100644 --- a/nixos/modules/security/grsecurity.nix +++ b/nixos/modules/security/grsecurity.nix @@ -290,6 +290,7 @@ in wantedBy = [ "multi-user.target" ]; serviceConfig.Type = "oneshot"; serviceConfig.RemainAfterExit = "yes"; + unitConfig.ConditionPathIsReadWrite = "/proc/sys/kernel/grsecurity/grsec_lock"; script = '' locked=`cat /proc/sys/kernel/grsecurity/grsec_lock` if [ "$locked" == "0" ]; then