From patchwork Tue Jan 28 02:00:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Sergeev X-Patchwork-Id: 314546 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id C517A2C0099 for ; Tue, 28 Jan 2014 13:07:48 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 60ED193E8A; Tue, 28 Jan 2014 02:07:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id edQM34ABBhh3; Tue, 28 Jan 2014 02:07:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 3CC3B93E79; Tue, 28 Jan 2014 02:07:43 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id E64B41C2110 for ; Tue, 28 Jan 2014 02:07:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id DED9F8D0BB for ; Tue, 28 Jan 2014 02:07:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4WAksjkdwEPQ for ; Tue, 28 Jan 2014 02:07:40 +0000 (UTC) X-Greylist: delayed 00:07:17 by SQLgrey-1.7.6 Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by whitealder.osuosl.org (Postfix) with ESMTPS id DA3F98D0B7 for ; Tue, 28 Jan 2014 02:07:40 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id fa1so6731929pad.27 for ; Mon, 27 Jan 2014 18:07:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=tknuw51Td2hUSwRrKjYe7lqspfkA+QR3V6N0vGqivvU=; b=RPO6XLYSaUvO47bbMrvX6q+rWHPHz+xiKaFt3dkZ2teZlrv5vAN20j92V6PZ5Hi1bf Ga9NMvsl3ldsyZdrHpP9x13DQ3G9ZdCYYU0OvBhJWkWB02tCZfPhFEwpZcedwMXvUPWZ 3qcqLlJSK7lHrk4Cer/xSoqjHiItq2pQM7R9LRczdO73c5GRQ8ON5siIJoJVuT/2/q4o yycc6QloPrFYGZSlqhP/mlU51gB30ceKPl8dKcXRS78WMOG7RzDa76hvZgDqooNiCPE2 D7u94K63kNvNVrGJ6DkDzAuNQSF+2ow3N8/Jvw+64k+jeJcX1XC9UMcelvZXU/c05AzD ypAg== X-Gm-Message-State: ALoCoQmdjmryMz+cSSiiZ9EDt3q+kL41bNoy8U1DPeeE5ARfN7ANYGwtpRqG2e+7WzNEzTyoPEZi X-Received: by 10.67.23.135 with SMTP id ia7mr33051742pad.5.1390874423531; Mon, 27 Jan 2014 18:00:23 -0800 (PST) Received: from vsergeev-arch.kumu.lan. (23-24-194-1-static.hfc.comcastbusiness.net. [23.24.194.1]) by mx.google.com with ESMTPSA id qz9sm36389530pbc.3.2014.01.27.18.00.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Jan 2014 18:00:22 -0800 (PST) From: Ivan Sergeev To: buildroot@busybox.net Date: Mon, 27 Jan 2014 18:00:05 -0800 Message-Id: <1390874405-25944-1-git-send-email-vsergeev@kumunetworks.com> X-Mailer: git-send-email 1.8.5.3 Subject: [Buildroot] [PATCH 1/1] ntp: add systemd unit file for ntpd X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Signed-off-by: Ivan Sergeev Reviewed-by: Arnout Vandecappelle (Essensium/Mind) --- package/ntp/ntp.mk | 13 ++++++++++++- package/ntp/ntpd.service | 11 +++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 package/ntp/ntpd.service diff --git a/package/ntp/ntp.mk b/package/ntp/ntp.mk index 40d8e4f..fe64a21 100644 --- a/package/ntp/ntp.mk +++ b/package/ntp/ntp.mk @@ -52,13 +52,24 @@ NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_TICKADJ) += util/tickadj define NTP_INSTALL_TARGET_CMDS $(if $(BR2_PACKAGE_NTP_NTPD), install -m 755 $(@D)/ntpd/ntpd $(TARGET_DIR)/usr/sbin/ntpd) test -z "$(NTP_INSTALL_FILES_y)" || install -m 755 $(addprefix $(@D)/,$(NTP_INSTALL_FILES_y)) $(TARGET_DIR)/usr/bin/ - $(if $(BR2_PACKAGE_NTP_NTPD), install -m 755 package/ntp/S49ntp $(TARGET_DIR)/etc/init.d/S49ntp) @if [ ! -f $(TARGET_DIR)/etc/default/ntpd ]; then \ install -m 755 -d $(TARGET_DIR)/etc/default ; \ install -m 644 package/ntp/ntpd.etc.default $(TARGET_DIR)/etc/default/ntpd ; \ fi endef +ifeq ($(BR2_PACKAGE_NTP_NTPD),y) +define NTP_INSTALL_INIT_SYSV + $(INSTALL) -D -m 755 package/ntp/S49ntp $(TARGET_DIR)/etc/init.d/S49ntp +endef + +define NTP_INSTALL_INIT_SYSTEMD + $(INSTALL) -D -m 644 package/ntp/ntpd.service $(TARGET_DIR)/etc/systemd/system/ntpd.service + mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants + ln -fs ../ntpd.service $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ntpd.service +endef +endif + NTP_POST_PATCH_HOOKS += NTP_PATCH_FIXUPS $(eval $(autotools-package)) diff --git a/package/ntp/ntpd.service b/package/ntp/ntpd.service new file mode 100644 index 0000000..7964c53 --- /dev/null +++ b/package/ntp/ntpd.service @@ -0,0 +1,11 @@ +[Unit] +Description=Network Time Service +After=network.target + +[Service] +Type=forking +PIDFile=/run/ntpd.pid +ExecStart=/usr/sbin/ntpd -g -p /run/ntpd.pid + +[Install] +WantedBy=multi-user.target