From e5df80a3f54da23858c382a8e491ff9901317e1e Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 20 Aug 2019 18:53:35 +0200 Subject: T1598: initial implementation of the hosts keeper daemon. --- src/systemd/vyos-hostsd.service | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/systemd/vyos-hostsd.service (limited to 'src/systemd') diff --git a/src/systemd/vyos-hostsd.service b/src/systemd/vyos-hostsd.service new file mode 100644 index 000000000..fe6c163d7 --- /dev/null +++ b/src/systemd/vyos-hostsd.service @@ -0,0 +1,22 @@ +[Unit] +Description=VyOS DNS configuration keeper +After=auditd.service systemd-user-sessions.service time-sync.target + +[Service] +ExecStart=/usr/bin/python3 -u /usr/libexec/vyos/services/vyos-hostsd +Type=idle +KillMode=process + +SyslogIdentifier=vyos-hostsd +SyslogFacility=daemon + +Restart=on-failure + +# Does't work but leave it here +User=root +Group=vyattacfg + +[Install] +# Installing in a earlier target leaves ExecStartPre waiting +WantedBy=getty.target + -- cgit v1.2.3 From 525438ac4ad1e4fba534c7d1c51283c4c2561d3e Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 20 Aug 2019 19:47:16 +0200 Subject: T1598: start vyos-hostsd before everything that may need it. --- src/systemd/vyos-hostsd.service | 1 + 1 file changed, 1 insertion(+) (limited to 'src/systemd') diff --git a/src/systemd/vyos-hostsd.service b/src/systemd/vyos-hostsd.service index fe6c163d7..8ff213d2b 100644 --- a/src/systemd/vyos-hostsd.service +++ b/src/systemd/vyos-hostsd.service @@ -1,6 +1,7 @@ [Unit] Description=VyOS DNS configuration keeper After=auditd.service systemd-user-sessions.service time-sync.target +Before=vyos-router.service cloud-init.service [Service] ExecStart=/usr/bin/python3 -u /usr/libexec/vyos/services/vyos-hostsd -- cgit v1.2.3 From db67a7e9e6f448567203ceb5f6364e78c7bb3300 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Thu, 22 Aug 2019 12:51:12 -0500 Subject: T1606: change vyos-hostsd systemd target to avoid boot problems --- src/systemd/vyos-hostsd.service | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/systemd') diff --git a/src/systemd/vyos-hostsd.service b/src/systemd/vyos-hostsd.service index 8ff213d2b..3b0fadb5c 100644 --- a/src/systemd/vyos-hostsd.service +++ b/src/systemd/vyos-hostsd.service @@ -1,7 +1,8 @@ [Unit] Description=VyOS DNS configuration keeper -After=auditd.service systemd-user-sessions.service time-sync.target -Before=vyos-router.service cloud-init.service +After=auditd.service time-sync.target +Before=network-pre.target vyos-router.service +Wants=network-pre.target [Service] ExecStart=/usr/bin/python3 -u /usr/libexec/vyos/services/vyos-hostsd @@ -18,6 +19,6 @@ User=root Group=vyattacfg [Install] -# Installing in a earlier target leaves ExecStartPre waiting -WantedBy=getty.target +# +WantedBy=network.target -- cgit v1.2.3 From ff05e2a90edf8af5d7b8ad5c69cae2dd40af2c8d Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Fri, 30 Aug 2019 18:40:44 +0200 Subject: T1598: fix vyos-hostsd unit dependencies. --- src/systemd/vyos-hostsd.service | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/systemd') diff --git a/src/systemd/vyos-hostsd.service b/src/systemd/vyos-hostsd.service index 3b0fadb5c..2444f5352 100644 --- a/src/systemd/vyos-hostsd.service +++ b/src/systemd/vyos-hostsd.service @@ -1,8 +1,7 @@ [Unit] Description=VyOS DNS configuration keeper -After=auditd.service time-sync.target -Before=network-pre.target vyos-router.service -Wants=network-pre.target +DefaultDependencies=no +After=systemd-remount-fs.service [Service] ExecStart=/usr/bin/python3 -u /usr/libexec/vyos/services/vyos-hostsd @@ -19,6 +18,4 @@ User=root Group=vyattacfg [Install] -# -WantedBy=network.target - +RequiredBy=cloud-init-local.service vyos-router.service -- cgit v1.2.3 From 59e5e64cfbb67a5eb1a9d4d21dd54d946897b8d7 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Wed, 11 Sep 2019 23:14:23 +0200 Subject: T1598: annotate the vyos-hostsd unit file. --- src/systemd/vyos-hostsd.service | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/systemd') diff --git a/src/systemd/vyos-hostsd.service b/src/systemd/vyos-hostsd.service index 2444f5352..731e570c9 100644 --- a/src/systemd/vyos-hostsd.service +++ b/src/systemd/vyos-hostsd.service @@ -1,6 +1,12 @@ [Unit] Description=VyOS DNS configuration keeper + +# Without this option, lots of default dependencies are added, +# among them network.target, which creates a dependency cycle DefaultDependencies=no + +# Seemingly sensible way to say "as early as the system is ready" +# All vyos-hostsd needs is read/write mounted root After=systemd-remount-fs.service [Service] @@ -13,9 +19,13 @@ SyslogFacility=daemon Restart=on-failure -# Does't work but leave it here +# Does't work in Jessie but leave it here User=root Group=vyattacfg [Install] + +# Note: After= doesn't actually create a dependency, +# it just sets order for the case when both services are to start, +# and without RequiredBy it *does not* set vyos-hostsd to start. RequiredBy=cloud-init-local.service vyos-router.service -- cgit v1.2.3