]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[538-kea-should-not-store-anything-in-var-kea-lsb-violation] Introduced runstatedir...
authorFrancis Dupont <fdupont@isc.org>
Fri, 31 May 2019 15:29:29 +0000 (17:29 +0200)
committerFrancis Dupont <fdupont@isc.org>
Tue, 18 Jun 2019 16:54:26 +0000 (12:54 -0400)
configure.ac
doc/guide/ddns.xml
doc/guide/dhcp4-srv.xml
doc/guide/dhcp6-srv.xml
src/bin/keactrl/kea-dhcp4.conf.pre
src/bin/keactrl/keactrl.in
src/lib/process/Makefile.am
src/lib/process/daemon.h
src/lib/process/process_messages.mes
src/lib/process/tests/Makefile.am
src/lib/testutils/dhcp_test_lib.sh.in

index c8c26bbfe366be4f8b74ea796dc35431810eba65..8557c60d74a0185f2e74c051bdc4b9ef8079c9d3 100644 (file)
@@ -1527,6 +1527,13 @@ AM_COND_IF([HAVE_OPTRESET], [AC_DEFINE([HAVE_OPTRESET], [1], [Check for optreset
 
 AC_DEFINE([CONFIG_H_WAS_INCLUDED], [1], [config.h inclusion marker])
 
+# Autoconf 2.70 has runstatedir but is not yet released.
+if test "x$runstatedir" = "x"; then
+    AC_ARG_VAR(runstatedir, [$localstatedir/run for autoconf < 2.70])
+    runstatedir="$localstatedir/run"
+    AC_SUBST(runstatedir)
+fi
+
 AC_CONFIG_FILES([Makefile
                  compatcheck/Makefile
                  doc/Makefile
index b96f1881e6a142881cb027010ff7edd927c9fd73..879cac36956e46ecf9f041cc06a72b3b7450e064 100644 (file)
@@ -174,12 +174,12 @@ strings <userinput>path</userinput>/kea-dhcp-ddns | sed -n 's/;;;; //p'
 
       <para>
         During startup the server will attempt to create a PID file of the
-        form: [localstatedir]/[conf name].kea-dhcp-ddns.pid
+        form: [runstatedir]/[conf name].kea-dhcp-ddns.pid
         where:
         <itemizedlist>
             <listitem>
-            <simpara><command>localstatedir</command>: The value as passed into the
-            build configure script; it defaults to "/usr/local/var". Note
+            <simpara><command>runstatedir</command>: The value as passed into the
+            build configure script; it defaults to "/usr/local/var/run". Note
             that this value may be overridden at runtime by setting the environment
             variable KEA_PIDFILE_DIR. This is intended primarily for testing purposes.
             </simpara>
index 9ec5d368ab725a4e74b99515c9834ecf47c41684..83b56a47acda7287ba952c86eb1a6796764d0439 100644 (file)
 
       <para>
         During startup, the server will attempt to create a PID file of the
-        form: [localstatedir]/[conf name].kea-dhcp4.pid where:
+        form: [runstatedir]/[conf name].kea-dhcp4.pid where:
         <itemizedlist>
             <listitem>
-            <simpara><command>localstatedir</command>: The value as passed into the
-            build configure script; it defaults to "/usr/local/var". Note
+            <simpara><command>runstatedir</command>: The value as passed into the
+            build configure script; it defaults to "/usr/local/var/run". Note
             that this value may be overridden at runtime by setting the environment
             variable KEA_PIDFILE_DIR, although this is intended primarily for testing purposes.
             </simpara>
index c91b122ad3884e6e82826c48897a8c2b86a0ce7b..01c4fd2112e5a81f6854c0fcd3bc704c83a62afa 100644 (file)
 
       <para>
         During startup, the server will attempt to create a PID file of the
-        form: localstatedir]/[conf name].kea-dhcp6.pid where:
+        form: [runstatedir]/[conf name].kea-dhcp6.pid where:
         <itemizedlist>
             <listitem>
-            <simpara><command>localstatedir</command>: The value as passed into the
-            build configure script; it defaults to "/usr/local/var". Note
+            <simpara><command>runstatedir</command>: The value as passed into the
+            build configure script; it defaults to "/usr/local/var/run". Note
             that this value may be overridden at runtime by setting the environment
             variable KEA_PIDFILE_DIR, although this is intended primarily for testing purposes.
             </simpara>
index 2252b03924a9ef45665fd63605560bd2e3440334..60d396e242a8e65033b16ea88f845981346ffef2 100644 (file)
     //      // of all devices serviced by Kea, including their identifiers
     //      // (like MAC address), their location in the network, times
     //      // when they were active etc.
-    //      "library": "@localstatedir@/kea/libdhcp_legal_log.so"
+    //      "library": "@libdir@/kea/hooks/libdhcp_legal_log.so"
     //      "parameters": {
     //          "path": "/var/kea/var",
     //          "base-name": "kea-forensic4"
     //      // of specific options or perhaps even a combination of several
     //      // options and fields to uniquely identify a client. Those scenarios
     //      // are addressed by the Flexible Identifiers hook application.
-    //      "library": "@localstatedir@/kea/libdhcp_flex_id.so",
+    //      "library": "@libdir@/kea/hooks/libdhcp_flex_id.so",
     //      "parameters": {
     //          "identifier-expression": "substring(relay6[0].option[18],0,8)"
     //      }
index 0dd2f29ba8f9c816813f0733803dac7e7650c525..c5af47a4fd0eeaa89a68c568391d3dd1a0e28ac6 100644 (file)
@@ -99,9 +99,9 @@ get_pid_from_file() {
     local conf_name
     conf_name=$(basename -- "${kea_config_file}" | cut -f1 -d'.')
 
-    # Default the directory to --localstatedir
+    # Default the directory to --localstatedir / run
     local pid_file_dir
-    pid_file_dir=@localstatedir@/@PACKAGE@
+    pid_file_dir=@runstatedir@/@PACKAGE@
 
     # Use directory override if set (primarily for testing only)
     if [ -n "$KEA_PIDFILE_DIR" ]; then
@@ -333,7 +333,7 @@ run_conditional() {
 # to the default file.
 if [ -z "${KEA_LOGGER_DESTINATION}" ]; then
     prefix=@prefix@
-    export KEA_LOGGER_DESTINATION=@localstatedir@/@PACKAGE@/kea.log
+    export KEA_LOGGER_DESTINATION=@localstatedir@/log/kea.log
 fi
 
 command=${1}
index b8b58caef5305276a3f3e53e104a06f8bcc03f81..29b386803244198552d094d230fcefcbd76c0055 100644 (file)
@@ -1,5 +1,5 @@
 SUBDIRS = . testutils tests
-dhcp_data_dir = @localstatedir@/@PACKAGE@
+dhcp_data_dir = @runstatedir@/@PACKAGE@
 AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
 AM_CPPFLAGS += -DDATA_DIR="\"$(dhcp_data_dir)\""
 
index 7ef812d952ba1eade8d598423f2b0120fac26b11..91a2412dba37558cb2077e3864078c4a7d89122e 100644 (file)
@@ -268,7 +268,7 @@ private:
     std::string proc_name_;
 
     /// @brief Pointer to the directory where PID file(s) are written
-    /// It defaults to --localstatedir
+    /// It defaults to --localstatedir / run
     std::string pid_file_dir_;
 
     /// @brief Pointer to the PID file for this process
index e130e7d53c56695c6e22182df5ee90160fac862d..6e60b0383a14bbccc6b6585ca2b3e973407ec72b 100644 (file)
@@ -107,9 +107,9 @@ This is an error message that occurs when the server is unable to create
 its PID file.  The log message should contain details sufficient to
 determine the underlying cause.  The most likely culprits are that
 some portion of the pathname does not exist or a permissions issue. The
-default path is determined by --localstatedir configure parameter but
-may be overridden by setting environment variable, KEA_PIDFILE_DIR.  The
-first argument is the process name.
+default path is determined by --localstatedir or --runstatedir configure
+parameters but may be overridden by setting environment variable,
+KEA_PIDFILE_DIR.  The first argument is the process name.
 
 % DCTL_PROCESS_FAILED %1 application execution failed: %2
 The controller has encountered a fatal error while running the
index 253a9c378c620031d8713eb931a667517696aed4..2fb87683e6d4b2306fd0c257764e7149cb7757a9 100644 (file)
@@ -1,5 +1,5 @@
 SUBDIRS = .
-dhcp_data_dir = @localstatedir@/@PACKAGE@
+dhcp_data_dir = @runstatedir@/@PACKAGE@
 AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
 AM_CPPFLAGS += $(BOOST_INCLUDES)
 AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/lib/process/tests\"
index b00fc22058d9afced8cdf86f105a8a8f92edb778..462522ca7e99d73df0ee48eef5607702270094da 100644 (file)
@@ -257,9 +257,9 @@ set_logger() {
     export KEA_LOGGER_DESTINATION=${LOG_FILE}
 }
 
-# PID file path is by default <kea-install-dir>/var/kea, but can be
+# PID file path is by default <kea-install-dir>/var/run/kea, but can be
 # overridden by the environmental variable.
-PID_FILE_PATH=@localstatedir@/@PACKAGE@/
+PID_FILE_PATH=@runstatedir@/@PACKAGE@/
 if [ ! -z ${KEA_PIDFILE_DIR} ]; then
     PID_FILE_PATH="${KEA_PIDFILE_DIR}"
 fi