From: Marcin Siodelski Date: Thu, 12 Jun 2014 12:25:39 +0000 (+0200) Subject: [3422] keactrl and related configuration files are now installed. X-Git-Tag: trac3434_base~6^2~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=732c16063cd1f91fa81d89c154105b6815b45d06;p=thirdparty%2Fkea.git [3422] keactrl and related configuration files are now installed. --- diff --git a/configure.ac b/configure.ac index 6dfc171eab..bd3b4fc13a 100644 --- a/configure.ac +++ b/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_libraries.h src/bin/keactrl/keactrl + src/bin/keactrl/keactrl.conf src/bin/keactrl/Makefile src/bin/keactrl/tests/keactrl_tests.sh src/bin/keactrl/tests/Makefile diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 121d43aad1..1f43434618 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -1,6 +1,6 @@ # The following build order must be maintained. SUBDIRS = bind10 bindctl cfgmgr msgq cmdctl \ usermgr stats tests sockcreator dhcp4 dhcp6 \ - d2 sysinfo + d2 sysinfo keactrl check-recursive: all-recursive diff --git a/src/bin/keactrl/.gitignore b/src/bin/keactrl/.gitignore index cb2e5794bb..052400cae4 100644 --- a/src/bin/keactrl/.gitignore +++ b/src/bin/keactrl/.gitignore @@ -1 +1,2 @@ keactrl +keactrl.conf diff --git a/src/bin/keactrl/Makefile.am b/src/bin/keactrl/Makefile.am index d8f15911f7..627da00149 100644 --- a/src/bin/keactrl/Makefile.am +++ b/src/bin/keactrl/Makefile.am @@ -1,7 +1,20 @@ 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 -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 diff --git a/src/bin/keactrl/keactrl.conf.in b/src/bin/keactrl/keactrl.conf.in new file mode 100644 index 0000000000..c878742b39 --- /dev/null +++ b/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 diff --git a/src/bin/keactrl/keactrl.in b/src/bin/keactrl/keactrl.in index a756bcda29..520ffef856 100644 --- a/src/bin/keactrl/keactrl.in +++ b/src/bin/keactrl/keactrl.in @@ -133,10 +133,10 @@ if test -n "${KEACTRL_BUILD_DIR}"; then else prefix=@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 - keactrl_conf=@etcdir@/@PACKAGE@/keactrl.conf + keactrl_conf=@sysconfdir@/@PACKAGE@/keactrl.conf fi # 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. 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 fi @@ -160,6 +160,9 @@ fi if [ -z ${kea_config_file} ]; then log_error "Configuration file for Kea not specified." exit 1 +elif [ ! -f ${kea_config_file} ]; then + log_error "Configuration file for Kea does not exist: ${kea_config_file}." + exit 1 fi # kea4 and kea6 (=yes) indicate if we should start DHCPv4 and DHCPv6 server