From: Bruno Thomsen <bruno.thomsen@gmail.com>
To: ptxdist@pengutronix.de
Cc: Bruno Thomsen <bruno.thomsen@gmail.com>, bth@kamstrup.com
Subject: [ptxdist] [PATCH v2 3/6] chrony: systemd unit option
Date: Wed, 29 Jul 2020 21:29:25 +0200 [thread overview]
Message-ID: <20200729192928.5765-3-bruno.thomsen@gmail.com> (raw)
In-Reply-To: <20200729192928.5765-1-bruno.thomsen@gmail.com>
Include examples/chronyd.service from package in projectroot
so install_alternativ statment works.
Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
---
Changes since version 1:
- Fix install_alternative statement for service file.
- Added chrony-3.5/examples/chronyd.service to projectroot.
.../usr/lib/systemd/system/chronyd.service | 18 ++++++++++++++++++
rules/chrony.in | 7 +++++++
rules/chrony.make | 7 +++++++
3 files changed, 32 insertions(+)
create mode 100644 projectroot/usr/lib/systemd/system/chronyd.service
diff --git a/projectroot/usr/lib/systemd/system/chronyd.service b/projectroot/usr/lib/systemd/system/chronyd.service
new file mode 100644
index 000000000..289548cba
--- /dev/null
+++ b/projectroot/usr/lib/systemd/system/chronyd.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=NTP client/server
+Documentation=man:chronyd(8) man:chrony.conf(5)
+After=ntpdate.service sntp.service ntpd.service
+Conflicts=ntpd.service systemd-timesyncd.service
+ConditionCapability=CAP_SYS_TIME
+
+[Service]
+Type=forking
+PIDFile=/run/chrony/chronyd.pid
+EnvironmentFile=-/etc/sysconfig/chronyd
+ExecStart=/usr/sbin/chronyd $OPTIONS
+PrivateTmp=yes
+ProtectHome=yes
+ProtectSystem=full
+
+[Install]
+WantedBy=multi-user.target
diff --git a/rules/chrony.in b/rules/chrony.in
index c81eba868..16b730199 100644
--- a/rules/chrony.in
+++ b/rules/chrony.in
@@ -95,6 +95,13 @@ endif
config CHRONY_STARTSCRIPT
bool
default y
+ depends on INITMETHOD_BBINIT
prompt "install /etc/init.d/chrony"
+config CHRONY_SYSTEMD_UNIT
+ bool
+ default y
+ depends on INITMETHOD_SYSTEMD
+ prompt "install systemd unit files"
+
endif
diff --git a/rules/chrony.make b/rules/chrony.make
index c7571cfc8..a11ee5c5e 100644
--- a/rules/chrony.make
+++ b/rules/chrony.make
@@ -107,6 +107,13 @@ ifneq ($(call remove_quotes, $(PTXCONF_CHRONY_BBINIT_LINK)),)
endif
endif
endif
+
+ifdef PTXCONF_CHRONY_SYSTEMD_UNIT
+ @$(call install_alternative, chrony, 0, 0, 0644, /usr/lib/systemd/system/chronyd.service)
+ @$(call install_link, chrony, ../chronyd.service, \
+ /usr/lib/systemd/system/multi-user.target.wants/chronyd.service)
+endif
+
@$(call install_finish, chrony)
@$(call touch)
--
2.26.2
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
next prev parent reply other threads:[~2020-07-29 19:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-29 19:29 [ptxdist] [PATCH v2 1/6] chrony: version bump 3.3 -> 3.5 Bruno Thomsen
2020-07-29 19:29 ` [ptxdist] [PATCH v2 2/6] chrony: nettle authentication support Bruno Thomsen
2020-07-29 19:29 ` Bruno Thomsen [this message]
2020-07-29 19:29 ` [ptxdist] [PATCH v2 4/6] passwd/group: added chrony UID/GID Bruno Thomsen
2020-07-29 19:29 ` [ptxdist] [PATCH v2 5/6] chrony: run as chrony user option Bruno Thomsen
2020-07-29 19:29 ` [ptxdist] [PATCH v2 6/6] chrony: advanced monitoring command option Bruno Thomsen
2020-07-30 10:09 ` [ptxdist] [PATCH v2 1/6] chrony: version bump 3.3 -> 3.5 Michael Olbrich
2020-07-31 15:59 ` Bruno Thomsen
2020-08-02 21:11 ` Roland Hieber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200729192928.5765-3-bruno.thomsen@gmail.com \
--to=bruno.thomsen@gmail.com \
--cc=bth@kamstrup.com \
--cc=ptxdist@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox