[Git][NTPsec/ntpsec][master] systemd: Remove extra dependencies
Eric S. Raymond
gitlab at mg.gitlab.com
Sun Nov 26 08:11:31 UTC 2017
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
dfb51aa4 by Richard Laager at 2017-11-26T01:15:40-06:00
systemd: Remove extra dependencies
The ntpviz services should not Requires=ntpd.service. That has the
effect of starting ntpd.service (if it was stopped) whenever the timer
fires. The same applies to ntploggps and gpsd.service. Instead, we
should use Requisite. We also need to do the same for ntp-wait.service;
while it has no timer, having a Requires=ntpd.service there ends up
causing the same problem for the ntpviz-* services by way of indirect
dependencies; this may be a systemd bug.
Also, instead of having timers.target pull in the timers, we have the
relevant daemon server (ntpd.service or gpsd.service) pull in the
timers. This way, if the daemon is not running, the timers don't run
either. This is especially important for gpsd.service. If one doesn't
have gpsd installed, ntploggps.timer / ntploggps.service would fail.
- - - - -
8 changed files:
- etc/ntp-wait.service
- etc/ntploggps.service
- etc/ntploggps.timer
- etc/ntplogtemp.timer
- etc/ntpviz-daily.service
- etc/ntpviz-daily.timer
- etc/ntpviz-weekly.service
- etc/ntpviz-weekly.timer
Changes:
=====================================
etc/ntp-wait.service
=====================================
--- a/etc/ntp-wait.service
+++ b/etc/ntp-wait.service
@@ -1,6 +1,6 @@
[Unit]
Description=Wait for ntpd to synchronize system clock
-Requires=ntpd.service
+Requisite=ntpd.service
After=ntpd.service
Conflicts=systemd-timesyncd.service
Wants=time-sync.target
=====================================
etc/ntploggps.service
=====================================
--- a/etc/ntploggps.service
+++ b/etc/ntploggps.service
@@ -1,7 +1,8 @@
[Unit]
Documentation=man:ntploggps(1)
Description=GPS information logger for ntpviz
-Requires=gpsd.service
+Requisite=gpsd.service
+After=gpsd.service
[Service]
Type=simple
=====================================
etc/ntploggps.timer
=====================================
--- a/etc/ntploggps.timer
+++ b/etc/ntploggps.timer
@@ -1,5 +1,6 @@
[Unit]
Description=Run ntploggps every five minutes
+Requisite=gpsd.service
[Timer]
OnBootSec=5min
@@ -7,4 +8,4 @@ OnUnitActiveSec=5min
Persistent=true
[Install]
-WantedBy=timers.target
+WantedBy=gpsd.service
=====================================
etc/ntplogtemp.timer
=====================================
--- a/etc/ntplogtemp.timer
+++ b/etc/ntplogtemp.timer
@@ -7,4 +7,4 @@ OnUnitActiveSec=5min
Persistent=true
[Install]
-WantedBy=timers.target
+WantedBy=ntpd.service
=====================================
etc/ntpviz-daily.service
=====================================
--- a/etc/ntpviz-daily.service
+++ b/etc/ntpviz-daily.service
@@ -1,7 +1,7 @@
[Unit]
Documentation=man:ntpviz(1)
Description=Graph daily information for NTP
-Requires=ntpd.service
+Requisite=ntpd.service
[Service]
Type=simple
=====================================
etc/ntpviz-daily.timer
=====================================
--- a/etc/ntpviz-daily.timer
+++ b/etc/ntpviz-daily.timer
@@ -6,4 +6,4 @@ OnCalendar=*:53:00
Persistent=true
[Install]
-WantedBy=timers.target
+WantedBy=ntpd.service
=====================================
etc/ntpviz-weekly.service
=====================================
--- a/etc/ntpviz-weekly.service
+++ b/etc/ntpviz-weekly.service
@@ -1,7 +1,7 @@
[Unit]
Documentation=man:ntpviz(1)
Description=Graph weekly information for NTP
-Requires=ntpd.service
+Requisite=ntpd.service
[Service]
Type=simple
=====================================
etc/ntpviz-weekly.timer
=====================================
--- a/etc/ntpviz-weekly.timer
+++ b/etc/ntpviz-weekly.timer
@@ -6,4 +6,4 @@ OnCalendar=11,23:45:00
Persistent=true
[Install]
-WantedBy=timers.target
+WantedBy=ntpd.service
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/dfb51aa4ca77f76efaef47a7788d96c37f12a04a
---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/dfb51aa4ca77f76efaef47a7788d96c37f12a04a
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20171126/437c8fea/attachment.html>
More information about the vc
mailing list