]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
configure: add options to set default pidfile and rtcdevice
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 22 Aug 2016 13:47:42 +0000 (15:47 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 22 Aug 2016 13:50:35 +0000 (15:50 +0200)
conf.c
configure
doc/Makefile.in
doc/chrony.conf.adoc

diff --git a/conf.c b/conf.c
index 316275b80d98e9e325542443e95645f4a67045f5..b6a2b185d63f7d265cd7ee7bcce76be0807d5dd0 100644 (file)
--- 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);
 }
index 16accf4d4bd3f138be442d7381581c3f225c7d0d..f2486b244182cc6ee622d05973a5bafe44650fd3 100755 (executable)
--- 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
index bd405df39b654f77bdc36a9e10386830dacc71a2..5d66c91a025607005a4a9b199115ab362a341925 100644 (file)
@@ -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;"
index af6f4cf78c1c078a389d5b846445c3215e50f48f..2968cde9f683c48fb2a37816cdac2c5a45adf420 100644 (file)
@@ -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.:
 +
 ----