nixos/systemd: remove separate coredump module
This commit is contained in:
@@ -468,6 +468,16 @@
|
|||||||
(which will place the parameters in <literal>/etc/sysctl.d/60-nixos.conf</literal>).
|
(which will place the parameters in <literal>/etc/sysctl.d/60-nixos.conf</literal>).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Coredumps are now acquired by <literal>systemd-coredump</literal> by default.
|
||||||
|
<literal>systemd-coredump</literal> behaviour can still be modified via
|
||||||
|
<option>systemd.coredump.extraConfig</option>.
|
||||||
|
To stick to the old behaviour (having the kernel dump to a file called <literal>core</literal>
|
||||||
|
in the working directory), without piping it through <literal>systemd-coredump</literal>, set
|
||||||
|
<option>boot.kernel.sysctl."kernel.core_pattern"</option> to <literal>"core"</literal>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -862,7 +862,6 @@
|
|||||||
./system/activation/activation-script.nix
|
./system/activation/activation-script.nix
|
||||||
./system/activation/top-level.nix
|
./system/activation/top-level.nix
|
||||||
./system/boot/binfmt.nix
|
./system/boot/binfmt.nix
|
||||||
./system/boot/coredump.nix
|
|
||||||
./system/boot/emergency-mode.nix
|
./system/boot/emergency-mode.nix
|
||||||
./system/boot/grow-partition.nix
|
./system/boot/grow-partition.nix
|
||||||
./system/boot/initrd-network.nix
|
./system/boot/initrd-network.nix
|
||||||
|
|||||||
@@ -226,6 +226,7 @@ with lib;
|
|||||||
(mkRemovedOptionModule [ "services" "mysql" "rootPassword" ] "Use socket authentication or set the password outside of the nix store.")
|
(mkRemovedOptionModule [ "services" "mysql" "rootPassword" ] "Use socket authentication or set the password outside of the nix store.")
|
||||||
(mkRemovedOptionModule [ "services" "zabbixServer" "dbPassword" ] "Use services.zabbixServer.database.passwordFile instead.")
|
(mkRemovedOptionModule [ "services" "zabbixServer" "dbPassword" ] "Use services.zabbixServer.database.passwordFile instead.")
|
||||||
(mkRemovedOptionModule [ "systemd" "generator-packages" ] "Use systemd.packages instead.")
|
(mkRemovedOptionModule [ "systemd" "generator-packages" ] "Use systemd.packages instead.")
|
||||||
|
(mkRemovedOptionModule [ "systemd" "coredump" "enable" ] "Enabled by default. Set boot.kernel.sysctl.\"kernel.core_pattern\" = \"core\"; to disable.")
|
||||||
|
|
||||||
# ZSH
|
# ZSH
|
||||||
(mkRenamedOptionModule [ "programs" "zsh" "enableSyntaxHighlighting" ] [ "programs" "zsh" "syntaxHighlighting" "enable" ])
|
(mkRenamedOptionModule [ "programs" "zsh" "enableSyntaxHighlighting" ] [ "programs" "zsh" "syntaxHighlighting" "enable" ])
|
||||||
|
|||||||
@@ -1,66 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
options = {
|
|
||||||
|
|
||||||
systemd.coredump = {
|
|
||||||
|
|
||||||
enable = mkOption {
|
|
||||||
default = false;
|
|
||||||
type = types.bool;
|
|
||||||
description = ''
|
|
||||||
Enables storing core dumps in systemd.
|
|
||||||
Note that this alone is not enough to enable core dumps. The maximum
|
|
||||||
file size for core dumps must be specified in limits.conf as well. See
|
|
||||||
<option>security.pam.loginLimits</option> and the limits.conf(5)
|
|
||||||
man page (these specify the core dump limits for user login sessions)
|
|
||||||
and <option>systemd.extraConfig</option> (where e.g.
|
|
||||||
<literal>DefaultLimitCORE=1000000</literal> can be specified to set
|
|
||||||
the core dump limit for systemd system-level services).
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
extraConfig = mkOption {
|
|
||||||
default = "";
|
|
||||||
type = types.lines;
|
|
||||||
example = "Storage=journal";
|
|
||||||
description = ''
|
|
||||||
Extra config options for systemd-coredump. See coredump.conf(5) man page
|
|
||||||
for available options.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkMerge [
|
|
||||||
(mkIf config.systemd.coredump.enable {
|
|
||||||
|
|
||||||
systemd.additionalUpstreamSystemUnits = [ "systemd-coredump.socket" "systemd-coredump@.service" ];
|
|
||||||
|
|
||||||
environment.etc."systemd/coredump.conf".text =
|
|
||||||
''
|
|
||||||
[Coredump]
|
|
||||||
${config.systemd.coredump.extraConfig}
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Have the kernel pass core dumps to systemd's coredump helper binary.
|
|
||||||
# From systemd's 50-coredump.conf file. See:
|
|
||||||
# <https://github.com/systemd/systemd/blob/v218/sysctl.d/50-coredump.conf.in>
|
|
||||||
boot.kernel.sysctl."kernel.core_pattern" = "|${pkgs.systemd}/lib/systemd/systemd-coredump %P %u %g %s %t %c %e";
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf (!config.systemd.coredump.enable) {
|
|
||||||
boot.kernel.sysctl."kernel.core_pattern" = mkDefault "core";
|
|
||||||
|
|
||||||
systemd.extraConfig =
|
|
||||||
''
|
|
||||||
DefaultLimitCORE=0:infinity
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -76,6 +76,10 @@ let
|
|||||||
"systemd-journald-dev-log.socket"
|
"systemd-journald-dev-log.socket"
|
||||||
"syslog.socket"
|
"syslog.socket"
|
||||||
|
|
||||||
|
# Coredumps.
|
||||||
|
"systemd-coredump.socket"
|
||||||
|
"systemd-coredump@.service"
|
||||||
|
|
||||||
# SysV init compatibility.
|
# SysV init compatibility.
|
||||||
"systemd-initctl.socket"
|
"systemd-initctl.socket"
|
||||||
"systemd-initctl.service"
|
"systemd-initctl.service"
|
||||||
@@ -540,6 +544,16 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.coredump.extraConfig = mkOption {
|
||||||
|
default = "";
|
||||||
|
type = types.lines;
|
||||||
|
example = "Storage=journal";
|
||||||
|
description = ''
|
||||||
|
Extra config options for systemd-coredump. See coredump.conf(5) man page
|
||||||
|
for available options.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
systemd.extraConfig = mkOption {
|
systemd.extraConfig = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
@@ -795,6 +809,7 @@ in
|
|||||||
DefaultMemoryAccounting=yes
|
DefaultMemoryAccounting=yes
|
||||||
DefaultTasksAccounting=yes
|
DefaultTasksAccounting=yes
|
||||||
''}
|
''}
|
||||||
|
DefaultLimitCORE=infinity
|
||||||
${config.systemd.extraConfig}
|
${config.systemd.extraConfig}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@@ -818,6 +833,12 @@ in
|
|||||||
${config.services.journald.extraConfig}
|
${config.services.journald.extraConfig}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
"systemd/coredump.conf".text =
|
||||||
|
''
|
||||||
|
[Coredump]
|
||||||
|
${config.systemd.coredump.extraConfig}
|
||||||
|
'';
|
||||||
|
|
||||||
"systemd/logind.conf".text = ''
|
"systemd/logind.conf".text = ''
|
||||||
[Login]
|
[Login]
|
||||||
KillUserProcesses=${if config.services.logind.killUserProcesses then "yes" else "no"}
|
KillUserProcesses=${if config.services.logind.killUserProcesses then "yes" else "no"}
|
||||||
|
|||||||
Reference in New Issue
Block a user