Merge pull request #155207 from rapenne-s/freshclam_when_internet
clamav: start freshclan after network-online target
This commit is contained in:
commit
199d4224e9
@ -9,7 +9,7 @@ let
|
|||||||
pkg = pkgs.clamav;
|
pkg = pkgs.clamav;
|
||||||
|
|
||||||
toKeyValue = generators.toKeyValue {
|
toKeyValue = generators.toKeyValue {
|
||||||
mkKeyValue = generators.mkKeyValueDefault {} " ";
|
mkKeyValue = generators.mkKeyValueDefault { } " ";
|
||||||
listsAsDuplicateKeys = true;
|
listsAsDuplicateKeys = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ in
|
|||||||
|
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = with types; attrsOf (oneOf [ bool int str (listOf str) ]);
|
type = with types; attrsOf (oneOf [ bool int str (listOf str) ]);
|
||||||
default = {};
|
default = { };
|
||||||
description = ''
|
description = ''
|
||||||
ClamAV configuration. Refer to <link xlink:href="https://linux.die.net/man/5/clamd.conf"/>,
|
ClamAV configuration. Refer to <link xlink:href="https://linux.die.net/man/5/clamd.conf"/>,
|
||||||
for details on supported values.
|
for details on supported values.
|
||||||
@ -59,7 +59,7 @@ in
|
|||||||
|
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = with types; attrsOf (oneOf [ bool int str (listOf str) ]);
|
type = with types; attrsOf (oneOf [ bool int str (listOf str) ]);
|
||||||
default = {};
|
default = { };
|
||||||
description = ''
|
description = ''
|
||||||
freshclam configuration. Refer to <link xlink:href="https://linux.die.net/man/5/freshclam.conf"/>,
|
freshclam configuration. Refer to <link xlink:href="https://linux.die.net/man/5/freshclam.conf"/>,
|
||||||
for details on supported values.
|
for details on supported values.
|
||||||
@ -104,7 +104,6 @@ in
|
|||||||
systemd.services.clamav-daemon = mkIf cfg.daemon.enable {
|
systemd.services.clamav-daemon = mkIf cfg.daemon.enable {
|
||||||
description = "ClamAV daemon (clamd)";
|
description = "ClamAV daemon (clamd)";
|
||||||
after = optional cfg.updater.enable "clamav-freshclam.service";
|
after = optional cfg.updater.enable "clamav-freshclam.service";
|
||||||
requires = optional cfg.updater.enable "clamav-freshclam.service";
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
restartTriggers = [ clamdConfigFile ];
|
restartTriggers = [ clamdConfigFile ];
|
||||||
|
|
||||||
@ -134,7 +133,7 @@ in
|
|||||||
systemd.services.clamav-freshclam = mkIf cfg.updater.enable {
|
systemd.services.clamav-freshclam = mkIf cfg.updater.enable {
|
||||||
description = "ClamAV virus database updater (freshclam)";
|
description = "ClamAV virus database updater (freshclam)";
|
||||||
restartTriggers = [ freshclamConfigFile ];
|
restartTriggers = [ freshclamConfigFile ];
|
||||||
|
after = [ "network-online.target" ];
|
||||||
preStart = ''
|
preStart = ''
|
||||||
mkdir -m 0755 -p ${stateDir}
|
mkdir -m 0755 -p ${stateDir}
|
||||||
chown ${clamavUser}:${clamavGroup} ${stateDir}
|
chown ${clamavUser}:${clamavGroup} ${stateDir}
|
||||||
|
Loading…
Reference in New Issue
Block a user