From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1k0rlt-0007L4-8w for ptxdist@pengutronix.de; Wed, 29 Jul 2020 21:29:50 +0200 Received: by mail-wr1-x42d.google.com with SMTP id a14so22713458wra.5 for ; Wed, 29 Jul 2020 12:29:49 -0700 (PDT) From: Bruno Thomsen Date: Wed, 29 Jul 2020 21:29:25 +0200 Message-Id: <20200729192928.5765-3-bruno.thomsen@gmail.com> In-Reply-To: <20200729192928.5765-1-bruno.thomsen@gmail.com> References: <20200729192928.5765-1-bruno.thomsen@gmail.com> MIME-Version: 1.0 Subject: [ptxdist] [PATCH v2 3/6] chrony: systemd unit option List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de Cc: Bruno Thomsen , bth@kamstrup.com Include examples/chronyd.service from package in projectroot so install_alternativ statment works. Signed-off-by: Bruno Thomsen --- 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