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.
This commit is contained in:
parent
a869c8351c
commit
ccd6f5a313
@ -290,6 +290,7 @@ in
|
|||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
serviceConfig.RemainAfterExit = "yes";
|
serviceConfig.RemainAfterExit = "yes";
|
||||||
|
unitConfig.ConditionPathIsReadWrite = "/proc/sys/kernel/grsecurity/grsec_lock";
|
||||||
script = ''
|
script = ''
|
||||||
locked=`cat /proc/sys/kernel/grsecurity/grsec_lock`
|
locked=`cat /proc/sys/kernel/grsecurity/grsec_lock`
|
||||||
if [ "$locked" == "0" ]; then
|
if [ "$locked" == "0" ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user