Parcourir la source

[3422] keactrl and related configuration files are now installed.

Marcin Siodelski il y a 11 ans
Parent
commit
732c16063c

+ 1 - 0
configure.ac

@@ -1457,6 +1457,7 @@ AC_CONFIG_FILES([compatcheck/Makefile
                  src/bin/dhcp6/tests/test_data_files_config.h
                  src/bin/dhcp6/tests/test_data_files_config.h
                  src/bin/dhcp6/tests/test_libraries.h
                  src/bin/dhcp6/tests/test_libraries.h
                  src/bin/keactrl/keactrl
                  src/bin/keactrl/keactrl
+                 src/bin/keactrl/keactrl.conf
                  src/bin/keactrl/Makefile
                  src/bin/keactrl/Makefile
                  src/bin/keactrl/tests/keactrl_tests.sh
                  src/bin/keactrl/tests/keactrl_tests.sh
                  src/bin/keactrl/tests/Makefile
                  src/bin/keactrl/tests/Makefile

+ 1 - 1
src/bin/Makefile.am

@@ -1,6 +1,6 @@
 # The following build order must be maintained.
 # The following build order must be maintained.
 SUBDIRS = bind10 bindctl cfgmgr msgq cmdctl \
 SUBDIRS = bind10 bindctl cfgmgr msgq cmdctl \
 	usermgr stats tests  sockcreator dhcp4 dhcp6 \
 	usermgr stats tests  sockcreator dhcp4 dhcp6 \
-	d2 sysinfo
+	d2 sysinfo keactrl
 
 
 check-recursive: all-recursive
 check-recursive: all-recursive

+ 1 - 0
src/bin/keactrl/.gitignore

@@ -1 +1,2 @@
 keactrl
 keactrl
+keactrl.conf

+ 15 - 2
src/bin/keactrl/Makefile.am

@@ -1,7 +1,20 @@
 SUBDIRS = . tests
 SUBDIRS = . tests
 
 
+# Install keactrl in sbin and the keactrl.conf required by the keactrl
+# in etc. keactrl will look for its configuration file in the etc folder.
+# If the default location needs to be changed the it may be achieved by
+# setting KEACTRL_CONF environment variable.
 sbin_SCRIPTS  = keactrl
 sbin_SCRIPTS  = keactrl
-CLEANFILES = keactrl
+CONFIGFILES = keactrl.conf
 
 
-EXTRA_DIST = keactrl.in
+DISTCLEANFILES = keactrl keactrl.conf
+EXTRA_DIST = keactrl.in keactrl.conf.in
+
+install-data-local:
+	$(mkinstalldirs) $(DESTDIR)/@sysconfdir@/@PACKAGE@
+	for f in $(CONFIGFILES) ; do	\
+	  if test ! -f $(DESTDIR)$(sysconfdir)/@PACKAGE@/$$f; then	\
+	    ${INSTALL_DATA} $$f $(DESTDIR)$(sysconfdir)/@PACKAGE@/ ;	\
+	  fi ;	\
+	done
 
 

+ 18 - 0
src/bin/keactrl/keactrl.conf.in

@@ -0,0 +1,18 @@
+# This is a configuration file for keactrl script which controls
+# the startup, shutdown, reconfiguration and gathering the status
+# of the Kea's processes.
+
+# prefix holds the location where the Kea is installed.
+prefix=@prefix@
+
+# Location of Kea configuration file.
+kea_config_file=@sysconfdir@/@PACKAGE@/kea.conf
+
+# Start DHCPv4 server?
+kea4=yes
+
+# Start DHCPv6 server?
+kea6=yes
+
+# Be verbose?
+kea_verbose=no

+ 7 - 4
src/bin/keactrl/keactrl.in

@@ -133,10 +133,10 @@ if test -n "${KEACTRL_BUILD_DIR}"; then
 else
 else
     prefix=@prefix@
     prefix=@prefix@
     exec_prefix=@exec_prefix@
     exec_prefix=@exec_prefix@
-    dhcpv4_srv=@libexecdir@/@PACKAGE@/dhcp4/b10-dhcp4
-    dhcpv6_srv=@libexecdir@/@PACKAGE@/dhcp6/b10-dhcp6
+    dhcpv4_srv=@libexecdir@/@PACKAGE@/b10-dhcp4
+    dhcpv6_srv=@libexecdir@/@PACKAGE@/b10-dhcp6
     dhcp_ddns=@libexecdir@/@PACKAGE@/b10-dhcp-ddns
     dhcp_ddns=@libexecdir@/@PACKAGE@/b10-dhcp-ddns
-    keactrl_conf=@etcdir@/@PACKAGE@/keactrl.conf
+    keactrl_conf=@sysconfdir@/@PACKAGE@/keactrl.conf
 fi
 fi
 
 
 # KEACTRL_CONF environment variable may hold a location of the keactrl
 # KEACTRL_CONF environment variable may hold a location of the keactrl
@@ -148,7 +148,7 @@ fi
 
 
 # Check if the file exists. If it doesn't, it is a fatal error.
 # Check if the file exists. If it doesn't, it is a fatal error.
 if [ ! -f ${keactrl_conf} ]; then
 if [ ! -f ${keactrl_conf} ]; then
-    log_error "keactrl configuration file doesn't exist."
+    log_error "keactrl configuration file doesn't exist in ${keactrl_conf}."
     exit 1
     exit 1
 fi
 fi
 
 
@@ -160,6 +160,9 @@ fi
 if [ -z ${kea_config_file} ]; then
 if [ -z ${kea_config_file} ]; then
     log_error "Configuration file for Kea not specified."
     log_error "Configuration file for Kea not specified."
     exit 1
     exit 1
+elif [ ! -f ${kea_config_file} ]; then
+    log_error "Configuration file for Kea does not exist: ${kea_config_file}."
+    exit 1
 fi
 fi
 
 
 # kea4 and kea6 (=yes) indicate if we should start DHCPv4 and DHCPv6 server
 # kea4 and kea6 (=yes) indicate if we should start DHCPv4 and DHCPv6 server