nscd: Ensure that invalidate-nscd starts after nscd
This commit is contained in:
parent
9f9ae7c7e9
commit
b11c5d5991
@ -27,7 +27,7 @@ in
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
###### implementation
|
###### implementation
|
||||||
|
|
||||||
config = mkIf config.services.nscd.enable {
|
config = mkIf config.services.nscd.enable {
|
||||||
@ -47,13 +47,18 @@ in
|
|||||||
|
|
||||||
preStart =
|
preStart =
|
||||||
''
|
''
|
||||||
mkdir -m 0755 -p /var/run/nscd
|
mkdir -m 0755 -p /run/nscd
|
||||||
|
rm -f /run/nscd/nscd.pid
|
||||||
mkdir -m 0755 -p /var/db/nscd
|
mkdir -m 0755 -p /var/db/nscd
|
||||||
'';
|
'';
|
||||||
|
|
||||||
path = [ pkgs.glibc ];
|
path = [ pkgs.glibc ];
|
||||||
|
|
||||||
exec = "nscd -f ${./nscd.conf} -d 2> /dev/null";
|
exec = "nscd -f ${./nscd.conf}";
|
||||||
|
|
||||||
|
daemonType = "fork";
|
||||||
|
|
||||||
|
serviceConfig = "PIDFile=/run/nscd/nscd.pid";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Flush nscd's ‘hosts’ database when the network comes up or the
|
# Flush nscd's ‘hosts’ database when the network comes up or the
|
||||||
@ -62,6 +67,7 @@ in
|
|||||||
{ name = "invalidate-nscd";
|
{ name = "invalidate-nscd";
|
||||||
description = "Invalidate NSCD cache";
|
description = "Invalidate NSCD cache";
|
||||||
startOn = "ip-up or config-changed";
|
startOn = "ip-up or config-changed";
|
||||||
|
after = [ "nscd.service" ];
|
||||||
task = true;
|
task = true;
|
||||||
exec = "${pkgs.glibc}/sbin/nscd --invalidate hosts";
|
exec = "${pkgs.glibc}/sbin/nscd --invalidate hosts";
|
||||||
};
|
};
|
||||||
|
@ -2,6 +2,18 @@
|
|||||||
|
|
||||||
with pkgs.lib;
|
with pkgs.lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
issueFile = pkgs.writeText "issue" ''
|
||||||
|
|
||||||
|
[1;32m${config.services.mingetty.greetingLine}[0m
|
||||||
|
xyzzy6
|
||||||
|
${config.services.mingetty.helpLine}
|
||||||
|
|
||||||
|
'';
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
###### interface
|
###### interface
|
||||||
@ -79,7 +91,7 @@ with pkgs.lib;
|
|||||||
[Service]
|
[Service]
|
||||||
Environment=TERM=linux
|
Environment=TERM=linux
|
||||||
Environment=LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive
|
Environment=LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive
|
||||||
ExecStart=@${pkgs.utillinux}/sbin/agetty agetty --noclear --login-program ${pkgs.shadow}/bin/login %I 38400
|
ExecStart=@${pkgs.utillinux}/sbin/agetty agetty --noclear -f ${issueFile} --login-program ${pkgs.shadow}/bin/login %I 38400
|
||||||
Type=idle
|
Type=idle
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=0
|
RestartSec=0
|
||||||
@ -95,7 +107,7 @@ with pkgs.lib;
|
|||||||
# instead, to ensure that login terminates cleanly.
|
# instead, to ensure that login terminates cleanly.
|
||||||
KillSignal=SIGHUP
|
KillSignal=SIGHUP
|
||||||
'';
|
'';
|
||||||
|
|
||||||
boot.systemd.units."serial-getty@.service".text =
|
boot.systemd.units."serial-getty@.service".text =
|
||||||
''
|
''
|
||||||
[Unit]
|
[Unit]
|
||||||
@ -131,12 +143,7 @@ with pkgs.lib;
|
|||||||
|
|
||||||
environment.etc = singleton
|
environment.etc = singleton
|
||||||
{ # Friendly greeting on the virtual consoles.
|
{ # Friendly greeting on the virtual consoles.
|
||||||
source = pkgs.writeText "issue" ''
|
source = issueFile;
|
||||||
|
|
||||||
[1;32m${config.services.mingetty.greetingLine}[0m
|
|
||||||
${config.services.mingetty.helpLine}
|
|
||||||
|
|
||||||
'';
|
|
||||||
target = "issue";
|
target = "issue";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -54,14 +54,15 @@ let
|
|||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
|
|
||||||
inherit (job) description path environment;
|
inherit (job) description requires wants before environment path;
|
||||||
|
|
||||||
after =
|
after =
|
||||||
if job.startOn == "stopped udevtrigger" then [ "systemd-udev-settle.service" ] else
|
(if job.startOn == "stopped udevtrigger" then [ "systemd-udev-settle.service" ] else
|
||||||
if job.startOn == "started udev" then [ "systemd-udev.service" ] else
|
if job.startOn == "started udev" then [ "systemd-udev.service" ] else
|
||||||
[];
|
[]) ++ job.after;
|
||||||
|
|
||||||
wantedBy = if job.startOn == "" then [ ] else [ "multi-user.target" ];
|
wantedBy =
|
||||||
|
(if job.startOn == "" then [ ] else [ "multi-user.target" ]) ++ job.wantedBy;
|
||||||
|
|
||||||
serviceConfig =
|
serviceConfig =
|
||||||
''
|
''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user