]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
conf: rename confdirs and sourcedirs directives
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 18 Aug 2020 12:21:06 +0000 (14:21 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 20 Aug 2020 11:27:46 +0000 (13:27 +0200)
Rename the directives to confdir and sourcedir to better match an
expected use case with only one specified directory.

conf.c
doc/chrony.conf.adoc
doc/chronyc.adoc
doc/chronyd.adoc

diff --git a/conf.c b/conf.c
index b3061c96065705a106e68e551ce704d1a36cef72..94c4dbb01a148cd4c77e96afe13ef8bf380415d4 100644 (file)
--- a/conf.c
+++ b/conf.c
@@ -65,7 +65,7 @@ static void parse_bindaddress(char *);
 static void parse_bindcmdaddress(char *);
 static void parse_broadcast(char *);
 static void parse_clientloglimit(char *);
-static void parse_confdirs(char *);
+static void parse_confdir(char *);
 static void parse_fallbackdrift(char *);
 static void parse_hwtimestamp(char *);
 static void parse_include(char *);
@@ -81,7 +81,7 @@ static void parse_ratelimit(char *line, int *enabled, int *interval,
 static void parse_refclock(char *);
 static void parse_smoothtime(char *);
 static void parse_source(char *line, char *type, int fatal);
-static void parse_sourcedirs(char *);
+static void parse_sourcedir(char *);
 static void parse_tempcomp(char *);
 
 /* ================================================== */
@@ -519,7 +519,7 @@ CNF_ParseLine(const char *filename, int number, char *line)
   processed_command = command = line;
   p = CPS_SplitWord(line);
 
-  if (print_config && strcasecmp(command, "include") && strcasecmp(command, "confdirs"))
+  if (print_config && strcasecmp(command, "include") && strcasecmp(command, "confdir"))
     printf("%s%s%s\n", command, p[0] != '\0' ? " " : "", p);
 
   if (!strcasecmp(command, "acquisitionport")) {
@@ -555,8 +555,8 @@ CNF_ParseLine(const char *filename, int number, char *line)
                     &cmd_ratelimit_burst, &cmd_ratelimit_leak);
   } else if (!strcasecmp(command, "combinelimit")) {
     parse_double(p, &combine_limit);
-  } else if (!strcasecmp(command, "confdirs")) {
-    parse_confdirs(p);
+  } else if (!strcasecmp(command, "confdir")) {
+    parse_confdir(p);
   } else if (!strcasecmp(command, "corrtimeratio")) {
     parse_double(p, &correction_time_ratio);
   } else if (!strcasecmp(command, "deny")) {
@@ -686,8 +686,8 @@ CNF_ParseLine(const char *filename, int number, char *line)
     parse_source(p, command, 1);
   } else if (!strcasecmp(command, "smoothtime")) {
     parse_smoothtime(p);
-  } else if (!strcasecmp(command, "sourcedirs")) {
-    parse_sourcedirs(p);
+  } else if (!strcasecmp(command, "sourcedir")) {
+    parse_sourcedir(p);
   } else if (!strcasecmp(command, "stratumweight")) {
     parse_double(p, &stratum_weight);
   } else if (!strcasecmp(command, "tempcomp")) {
@@ -790,7 +790,7 @@ parse_source(char *line, char *type, int fatal)
 /* ================================================== */
 
 static void
-parse_sourcedirs(char *line)
+parse_sourcedir(char *line)
 {
   char *s;
 
@@ -1588,7 +1588,7 @@ search_dirs(char *line, const char *suffix, void (*file_handler)(const char *pat
 /* ================================================== */
 
 static void
-parse_confdirs(char *line)
+parse_confdir(char *line)
 {
   if (!search_dirs(line, ".conf", CNF_ReadFile))
     command_parse_error();
index 5ea864db86286bef7822014c112e819599f4ab45..42e3997d92e0783a3fea0ce754931ce1cdfc56fa 100644 (file)
@@ -2191,22 +2191,25 @@ sendmail binary.
 
 === Miscellaneous
 
-[[confdirs]]*confdirs* _directory_...::
-The *confdirs* directive includes configuration files with the _.conf_ suffix
-from up to 10 directories. The files are included in the lexicographical order
-(ignoring the names of the directories). If multiple directories contain a file
-with the same name, only the first file in the order of the specified
-directories will be included. This enables a fragmented configuration, where
-existing fragments can be replaced by adding files to a different directory.
+[[confdir]]*confdir* _directory_...::
+The *confdir* directive includes configuration files with the _.conf_ suffix
+from a directory. The files are included in the lexicographical order of the
+file names.
++
+Multiple directories (up to 10) can be specified with a single *confdir*
+directive. In this case, if multiple directories contain a file with the same
+name, only the first file in the order of the specified directories will be
+included. This enables a fragmented configuration where existing fragments can
+be replaced by adding files to a different directory.
 +
 An example of the directive is:
 +
 ----
-confdirs @SYSCONFDIR@/chrony.d /var/run/chrony.d /usr/lib/chrony.d
+confdir @SYSCONFDIR@/chrony.d
 ----
 
-[[sourcedirs]]*sourcedirs* _directory_...::
-The *sourcedirs* directive is identical to the *confdirs* directive, except the
+[[sourcedir]]*sourcedir* _directory_...::
+The *sourcedir* directive is identical to the *confdir* directive, except the
 configuration files have the _.sources_ suffix, they can only specify NTP
 sources (i.e. use the *server*, *pool*, and *peer* directive), and can be
 reloaded by the <<chronyc.adoc#reload,*reload sources*>> command in
@@ -2217,12 +2220,12 @@ network interface by a networking script.
 An example of the directive is:
 +
 ----
-sourcedirs /var/run/chrony-dhcp
+sourcedir /var/run/chrony-dhcp
 ----
 
 [[include]]*include* _pattern_::
 The *include* directive includes a configuration file, or multiple configuration
-files if a wildcard pattern is specified. Unlike with the *confdirs* directive,
+files if a wildcard pattern is specified. Unlike with the *confdir* directive,
 the full name of the files needs to be specified and at least one file is
 required to exist.
 +
index bb0af01e9de41c4da21b6983fb9d21c140a05761..d0411c3dfd4a7a5f92d9955e44680fd41e0f5658 100644 (file)
@@ -931,7 +931,7 @@ to replace them immediately and not wait until they are marked as unreachable.
 [[reload]]*reload* *sources*::
 The *reload sources* command causes *chronyd* to re-read all _*.sources_ files
 from the directories specified by the
-<<chrony.conf.adoc#sourcedirs,*sourcedirs*>> directive.
+<<chrony.conf.adoc#sourcedir,*sourcedir*>> directive.
 
 [[sourcename]]*sourcename* _address_::
 The *sourcename* command prints the original hostname or address that was
index 0e5f9fbd002a37d30acf3ed3e8bd6f60f7bd966d..739950b9cad4f39ebf4a9d4f5b3f9e4cc1e46a3e 100644 (file)
@@ -80,7 +80,7 @@ default value is 0.
 When run in this mode, *chronyd* will print the configuration and exit. It will
 not detach from the terminal. This option can be used to verify the syntax of
 the configuration and get the whole configuration, even if it is split into
-multiple files and read by the *include* or *confdirs* directive.
+multiple files and read by the *include* or *confdir* directive.
 
 *-q*::
 When run in this mode, *chronyd* will set the system clock once and exit. It