From 98ba4ce4d58482c91c9febd49e42d3a3d894b546 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 22 Aug 2016 15:47:42 +0200 Subject: [PATCH] configure: add options to set default pidfile and rtcdevice --- conf.c | 4 ++-- configure | 14 ++++++++++++++ doc/Makefile.in | 4 ++++ doc/chrony.conf.adoc | 4 ++-- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/conf.c b/conf.c index 316275b..b6a2b18 100644 --- a/conf.c +++ b/conf.c @@ -333,8 +333,8 @@ CNF_Initialise(int r) dumpdir = Strdup("."); logdir = Strdup("."); bind_cmd_path = Strdup(DEFAULT_COMMAND_SOCKET); - pidfile = Strdup("/var/run/chronyd.pid"); - rtc_device = Strdup("/dev/rtc"); + pidfile = Strdup(DEFAULT_PID_FILE); + rtc_device = Strdup(DEFAULT_RTC_DEVICE); hwclock_file = Strdup(DEFAULT_HWCLOCK_FILE); user = Strdup(DEFAULT_USER); } diff --git a/configure b/configure index 16accf4..f2486b2 100755 --- a/configure +++ b/configure @@ -106,6 +106,8 @@ For better control, use the options below. since 1970-01-01 [50*365 days ago] --with-user=USER Specify default chronyd user [root] --with-hwclockfile=PATH Specify default path to hwclock(8) adjtime file + --with-pidfile=PATH Specify default pidfile [/var/run/chronyd.pid] + --with-rtcdevice=PATH Specify default path to RTC device [/dev/rtc] --with-sendmail=PATH Path to sendmail binary [/usr/lib/sendmail] --enable-debug Enable debugging support @@ -221,6 +223,8 @@ feat_ntp_signd=0 ntp_era_split="" default_user="root" default_hwclockfile="" +default_pidfile="/var/run/chronyd.pid" +default_rtcdevice="/dev/rtc" mail_program="/usr/lib/sendmail" for option @@ -337,6 +341,12 @@ do --with-hwclockfile=* ) default_hwclockfile=`echo $option | sed -e 's/^.*=//;'` ;; + --with-pidfile=* ) + default_pidfile=`echo $option | sed -e 's/^.*=//;'` + ;; + --with-rtcdevice=* ) + default_rtcdevice=`echo $option | sed -e 's/^.*=//;'` + ;; --with-sendmail=* ) mail_program=`echo $option | sed -e 's/^.*=//;'` ;; @@ -856,6 +866,8 @@ fi add_def DEFAULT_CONF_FILE "\"$SYSCONFDIR/chrony.conf\"" add_def DEFAULT_HWCLOCK_FILE "\"$default_hwclockfile\"" +add_def DEFAULT_PID_FILE "\"$default_pidfile\"" +add_def DEFAULT_RTC_DEVICE "\"$default_rtcdevice\"" add_def DEFAULT_USER "\"$default_user\"" add_def DEFAULT_COMMAND_SOCKET "\"$CHRONYSOCKDIR/chronyd.sock\"" add_def MAIL_PROGRAM "\"$mail_program\"" @@ -898,6 +910,8 @@ do s%@CHRONYSOCKDIR@%${CHRONYSOCKDIR}%;\ s%@CHRONYVARDIR@%${CHRONYVARDIR}%;\ s%@DEFAULT_HWCLOCK_FILE@%${default_hwclockfile}%;\ + s%@DEFAULT_PID_FILE@%${default_pidfile}%;\ + s%@DEFAULT_RTC_DEVICE@%${default_rtcdevice}%;\ s%@DEFAULT_USER@%${default_user}%;\ s%@CHRONY_VERSION@%${CHRONY_VERSION}%;" \ < ${f}.in > $f diff --git a/doc/Makefile.in b/doc/Makefile.in index bd405df..5d66c91 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -18,12 +18,16 @@ CHRONYVARDIR = @CHRONYVARDIR@ CHRONY_VERSION = @CHRONY_VERSION@ DEFAULT_USER = @DEFAULT_USER@ DEFAULT_HWCLOCK_FILE = @DEFAULT_HWCLOCK_FILE@ +DEFAULT_PID_FILE = @DEFAULT_PID_FILE@ +DEFAULT_RTC_DEVICE = @DEFAULT_RTC_DEVICE@ SED_COMMANDS = "s%\@SYSCONFDIR\@%$(SYSCONFDIR)%g;\ s%\@BINDIR\@%$(BINDIR)%g;\ s%\@SBINDIR\@%$(SBINDIR)%g;\ s%\@CHRONY_VERSION\@%$(CHRONY_VERSION)%g;\ s%\@DEFAULT_HWCLOCK_FILE\@%$(DEFAULT_HWCLOCK_FILE)%g;\ + s%\@DEFAULT_PID_FILE\@%$(DEFAULT_PID_FILE)%g;\ + s%\@DEFAULT_RTC_DEVICE\@%$(DEFAULT_RTC_DEVICE)%g;\ s%\@DEFAULT_USER\@%$(DEFAULT_USER)%g;\ s%\@CHRONYSOCKDIR\@%$(CHRONYSOCKDIR)%g;\ s%\@CHRONYVARDIR\@%$(CHRONYVARDIR)%g;" diff --git a/doc/chrony.conf.adoc b/doc/chrony.conf.adoc index af6f4cf..2968cde 100644 --- a/doc/chrony.conf.adoc +++ b/doc/chrony.conf.adoc @@ -1375,7 +1375,7 @@ This would set the threshold error to 30 seconds. [[rtcdevice]]*rtcdevice* _device_:: The *rtcdevice* directive sets the path to the device file for accessing the -RTC. The default path is _/dev/rtc_. +RTC. The default path is _@DEFAULT_RTC_DEVICE@_. [[rtcfile]]*rtcfile* _file_:: The *rtcfile* directive defines the name of the file in which *chronyd* can @@ -1782,7 +1782,7 @@ ntpsigndsocket /var/lib/samba/ntp_signd [[pidfile]]*pidfile* _file_:: *chronyd* always writes its process ID (PID) to a file, and checks this file on startup to see if another *chronyd* may already be running on the system. By -default, the file used is _/var/run/chronyd.pid_. The *pidfile* directive +default, the file used is _@DEFAULT_PID_FILE@_. The *pidfile* directive allows the name to be changed, e.g.: + ----