NetBSD Problem Report #42276
From www@NetBSD.org Fri Nov 6 08:22:03 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by www.NetBSD.org (Postfix) with ESMTP id AC4DB63B8CD
for <gnats-bugs@gnats.netbsd.org>; Fri, 6 Nov 2009 08:22:03 +0000 (UTC)
Message-Id: <20091106082203.762F763B844@www.NetBSD.org>
Date: Fri, 6 Nov 2009 08:22:03 +0000 (UTC)
From: jsl@apache.org
Reply-To: jsl@apache.org
To: gnats-bugs@NetBSD.org
Subject: ntp4 still does not honour SYSCONFDIR
X-Send-Pr-Version: www-1.0
>Number: 42276
>Category: pkg
>Synopsis: ntp4 still does not honour SYSCONFDIR
>Confidential: no
>Severity: non-critical
>Priority: high
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Nov 06 08:25:00 +0000 2009
>Last-Modified: Tue May 10 16:15:02 +0000 2011
>Originator: Jason Lingohr
>Release: Linux 2.4.31
>Organization:
>Environment:
Linux fully 2.4.31 #7 Wed Jul 20 16:40:54 EST 2005 i686 i686 i386 GNU/Linux
>Description:
As per ntp bug 382 (https://support.ntp.org/bugs/show_bug.cgi?id=382), the latest ntp4 (4.2.4p7) still has this issue.
I suggest as a workaround, supplying the config file path on the commandline via the rc script.
>How-To-Repeat:
Run it. Marvel at how it has been compiled to expect the conf file in /usr/pkg/etc when in fact a strings of the binary shows otherwise.
>Fix:
--- /usr/pkg/share/examples/rc.d/ntpd 2009-11-06 19:10:25.000000000 +1100
+++ rc.d/ntpd 2009-11-06 19:16:14.000000000 +1100
@@ -10,12 +10,15 @@
. /etc/rc.subr
+: ${ntpd_conf:=/usr/pkg/etc/ntp.conf}
+
name="ntpd"
rcvar=$name
command="/usr/pkg/bin/${name}"
pidfile="/var/run/${name}.pid"
start_precmd="ntpd_precmd"
-required_files="/usr/pkg/etc/ntp.conf"
+required_files="${ntpd_conf}"
+command_args="-c ${ntpd_conf}"
ntpd_precmd()
{
>Audit-Trail:
From: Emil Skoeldberg <esg@SDF.LONESTAR.ORG>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: pkg/42276
Date: Tue, 10 May 2011 16:11:42 +0000
Not only does ntp4 not pick up the correct configuration file, but the
pidfile is not found either:
matstaff04 ntp4 $ sudo /usr/pkg/etc/rc.d/ntpd status
ntpd is not running.
matstaff04 ntp4 $ sudo /usr/pkg/etc/rc.d/ntpd start
Starting ntpd.
matstaff04 ntp4 $ sudo /usr/pkg/etc/rc.d/ntpd status
ntpd is not running.
I propose the following patch:
matstaff04 ntp4 $ sudo cvs diff -u
Index: files/ntpd.sh
===================================================================
RCS file: /cvsroot/pkgsrc/net/ntp4/files/ntpd.sh,v
retrieving revision 1.2
diff -u -r1.2 ntpd.sh
--- files/ntpd.sh 28 Mar 2004 06:35:03 -0000 1.2
+++ files/ntpd.sh 10 May 2011 16:03:04 -0000
@@ -13,9 +13,11 @@
name="ntpd"
rcvar=$name
command="@PREFIX@/bin/${name}"
+conf_file="@PKG_SYSCONFDIR@/ntp.conf"
pidfile="/var/run/${name}.pid"
+command_args="-c ${conf_file} -p ${pidfile}"
start_precmd="ntpd_precmd"
-required_files="@PKG_SYSCONFDIR@/ntp.conf"
+required_files="${conf_file}"
ntpd_precmd()
{
--
esg@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.