Blame SOURCES/autofs-5.1.4-use-systemd-sd_notify-at-startup.patch

9ddfc2
autofs-5.1.4 - use systemd sd_notify() at startup
9ddfc2
9ddfc2
From: Ian Kent <raven@themaw.net>
9ddfc2
9ddfc2
autofs needs to ensure statd is started before any NFS mounts
9ddfc2
are attempted.
9ddfc2
9ddfc2
When starting the statd service with the autofs service the statd
9ddfc2
service will trigger a restart of the autofs service during its
9ddfc2
start up. Sometimes this can happen during the automount start up
9ddfc2
itself.
9ddfc2
9ddfc2
When this happens it causes systemd to become confused and remove
9ddfc2
the pid file created by automount leaving systemd thinking the
9ddfc2
autofs service had failed start up when it was actually running.
9ddfc2
9ddfc2
It was recommened that autofs be changed to a "Type=notify" service
9ddfc2
to avoid this. Using this a pid file is no longer needed and is now
9ddfc2
not used.
9ddfc2
9ddfc2
Signed-off-by: Ian Kent <raven@themaw.net>
9ddfc2
---
9ddfc2
 CHANGELOG                 |    1 
9ddfc2
 Makefile.conf.in          |    3 
9ddfc2
 aclocal.m4                |    2 
9ddfc2
 autofs.spec               |    1 
9ddfc2
 configure                 |  577 +++++++++++++++++++++++++++++++++++-----------
9ddfc2
 configure.in              |   10 
9ddfc2
 daemon/Makefile           |    5 
9ddfc2
 daemon/automount.c        |   83 ++++--
9ddfc2
 samples/autofs.service.in |    5 
9ddfc2
 9 files changed, 529 insertions(+), 158 deletions(-)
9ddfc2
9ddfc2
--- autofs-5.0.7.orig/CHANGELOG
9ddfc2
+++ autofs-5.0.7/CHANGELOG
9ddfc2
@@ -300,6 +300,7 @@
9ddfc2
 - fix fd leak in rpc_do_create_client().
9ddfc2
 - add man page note about extra slashes in paths.
9ddfc2
 - add units After line to include statd service.
9ddfc2
+- use systemd sd_notify() at startup.
9ddfc2
 
9ddfc2
 25/07/2012 autofs-5.0.7
9ddfc2
 =======================
9ddfc2
--- autofs-5.0.7.orig/Makefile.conf.in
9ddfc2
+++ autofs-5.0.7/Makefile.conf.in
9ddfc2
@@ -15,6 +15,9 @@ DAEMON_LDFLAGS = @DAEMON_LDFLAGS@
9ddfc2
 LIBNSL    = @LIBNSL@
9ddfc2
 LIBRESOLV = @LIBRESOLV@
9ddfc2
 
9ddfc2
+SYSTEMD = @WITH_SYSTEMD@
9ddfc2
+LIBSYSTEMD = @systemd_LIBS@
9ddfc2
+
9ddfc2
 # Hesiod support: yes (1) no (0)
9ddfc2
 HESIOD = @HAVE_HESIOD@
9ddfc2
 LIBHESIOD = @LIBHESIOD@
9ddfc2
--- autofs-5.0.7.orig/autofs.spec
9ddfc2
+++ autofs-5.0.7/autofs.spec
9ddfc2
@@ -28,6 +28,7 @@ Source: ftp://ftp.kernel.org/pub/linux/d
9ddfc2
 Buildroot: %{_tmppath}/%{name}-tmp
9ddfc2
 %if %{with_systemd}
9ddfc2
 BuildRequires: systemd-units
9ddfc2
+BuildRequires: systemd-devel
9ddfc2
 %endif
9ddfc2
 %if %{with_libtirpc}
9ddfc2
 BuildRequires: libtirpc-devel
9ddfc2
--- autofs-5.0.7.orig/configure.in
9ddfc2
+++ autofs-5.0.7/configure.in
9ddfc2
@@ -11,6 +11,9 @@ define([AC_CACHE_LOAD], )dnl
9ddfc2
 define([AC_CACHE_SAVE], )dnl
9ddfc2
 AC_INIT(.autofs-5.0.7)
9ddfc2
 
9ddfc2
+# for pkg-config macros
9ddfc2
+m4_include([/usr/share/aclocal/pkg.m4])
9ddfc2
+
9ddfc2
 #
9ddfc2
 # autofs installs by default in /usr
9ddfc2
 #
9ddfc2
@@ -45,6 +48,7 @@ AF_INIT_D()
9ddfc2
 AC_SUBST(initdir)
9ddfc2
 AF_PID_D()
9ddfc2
 AC_SUBST(piddir)
9ddfc2
+PKG_PROG_PKG_CONFIG()
9ddfc2
 
9ddfc2
 #
9ddfc2
 # Check for systemd unit files direectory exists if unit file installation
9ddfc2
@@ -52,6 +56,12 @@ AC_SUBST(piddir)
9ddfc2
 #
9ddfc2
 AF_WITH_SYSTEMD()
9ddfc2
 AC_SUBST(systemddir)
9ddfc2
+AC_SUBST(WITH_SYSTEMD)
9ddfc2
+PKG_CHECK_MODULES([systemd],[libsystemd],,
9ddfc2
+[
9ddfc2
+  AC_CHECK_LIB(systemd, sm_notify, systemd_LIBS="-lsystemd")
9ddfc2
+  AC_SUBST(systemd_LIBS)
9ddfc2
+])
9ddfc2
 
9ddfc2
 #
9ddfc2
 # Location of system config script directory?
9ddfc2
--- autofs-5.0.7.orig/daemon/Makefile
9ddfc2
+++ autofs-5.0.7/daemon/Makefile
9ddfc2
@@ -22,6 +22,11 @@ CFLAGS += -DVERSION_STRING=\"$(version)\
9ddfc2
 LDFLAGS += -rdynamic
9ddfc2
 LIBS = -ldl
9ddfc2
 
9ddfc2
+ifeq ($(SYSTEMD), 1)
9ddfc2
+    CFLAGS += -DWITH_SYSTEMD
9ddfc2
+    LIBS += $(LIBSYSTEMD)
9ddfc2
+endif
9ddfc2
+
9ddfc2
 ifeq ($(LDAP), 1)
9ddfc2
     CFLAGS += $(XML_FLAGS)
9ddfc2
     LIBS += $(XML_LIBS)
9ddfc2
--- autofs-5.0.7.orig/daemon/automount.c
9ddfc2
+++ autofs-5.0.7/daemon/automount.c
9ddfc2
@@ -36,6 +36,9 @@
9ddfc2
 #include <dirent.h>
9ddfc2
 #include <sys/vfs.h>
9ddfc2
 #include <sys/utsname.h>
9ddfc2
+#ifdef WITH_SYSTEMD
9ddfc2
+#include <systemd/sd-daemon.h>
9ddfc2
+#endif
9ddfc2
 
9ddfc2
 #include "automount.h"
9ddfc2
 #if defined(LIBXML2_WORKAROUND) || defined(TIRPC_WORKAROUND)
9ddfc2
@@ -65,7 +68,7 @@ unsigned int global_selection_options;
9ddfc2
 long global_negative_timeout = -1;
9ddfc2
 int do_force_unlink = 0;		/* Forceably unlink mount tree at startup */
9ddfc2
 
9ddfc2
-static int start_pipefd[2];
9ddfc2
+static int start_pipefd[2] = {-1, -1};
9ddfc2
 static int st_stat = 1;
9ddfc2
 static int *pst_stat = &st_stat;
9ddfc2
 static pthread_t state_mach_thid;
9ddfc2
@@ -1208,12 +1211,6 @@ static void become_daemon(unsigned foreg
9ddfc2
 		exit(0);
9ddfc2
 	}
9ddfc2
 
9ddfc2
-	if (open_pipe(start_pipefd) < 0) {
9ddfc2
-		fprintf(stderr, "%s: failed to create start_pipefd.\n",
9ddfc2
-			program);
9ddfc2
-		exit(0);
9ddfc2
-	}
9ddfc2
-
9ddfc2
 	/* Detach from foreground process */
9ddfc2
 	if (foreground) {
9ddfc2
 		if (daemon_check && !aquire_flag_file()) {
9ddfc2
@@ -1223,6 +1220,12 @@ static void become_daemon(unsigned foreg
9ddfc2
 		}
9ddfc2
 		log_to_stderr();
9ddfc2
 	} else {
9ddfc2
+		if (open_pipe(start_pipefd) < 0) {
9ddfc2
+			fprintf(stderr, "%s: failed to create start_pipefd.\n",
9ddfc2
+				program);
9ddfc2
+			exit(0);
9ddfc2
+		}
9ddfc2
+
9ddfc2
 		pid = fork();
9ddfc2
 		if (pid > 0) {
9ddfc2
 			close(start_pipefd[1]);
9ddfc2
@@ -2455,8 +2458,10 @@ int main(int argc, char *argv[])
9ddfc2
 	if (pthread_attr_init(&th_attr)) {
9ddfc2
 		logerr("%s: failed to init thread attribute struct!",
9ddfc2
 		     program);
9ddfc2
-		res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
-		close(start_pipefd[1]);
9ddfc2
+		if (start_pipefd[1] != -1) {
9ddfc2
+			res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
+			close(start_pipefd[1]);
9ddfc2
+		}
9ddfc2
 		release_flag_file();
9ddfc2
 		macro_free_global_table();
9ddfc2
 		exit(1);
9ddfc2
@@ -2465,8 +2470,10 @@ int main(int argc, char *argv[])
9ddfc2
 	if (pthread_attr_init(&th_attr_detached)) {
9ddfc2
 		logerr("%s: failed to init thread attribute struct!",
9ddfc2
 		     program);
9ddfc2
-		res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
-		close(start_pipefd[1]);
9ddfc2
+		if (start_pipefd[1] != -1) {
9ddfc2
+			res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
+			close(start_pipefd[1]);
9ddfc2
+		}
9ddfc2
 		release_flag_file();
9ddfc2
 		macro_free_global_table();
9ddfc2
 		exit(1);
9ddfc2
@@ -2476,8 +2483,10 @@ int main(int argc, char *argv[])
9ddfc2
 			&th_attr_detached, PTHREAD_CREATE_DETACHED)) {
9ddfc2
 		logerr("%s: failed to set detached thread attribute!",
9ddfc2
 		     program);
9ddfc2
-		res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
-		close(start_pipefd[1]);
9ddfc2
+		if (start_pipefd[1] != -1) {
9ddfc2
+			res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
+			close(start_pipefd[1]);
9ddfc2
+		}
9ddfc2
 		release_flag_file();
9ddfc2
 		macro_free_global_table();
9ddfc2
 		exit(1);
9ddfc2
@@ -2488,8 +2497,10 @@ int main(int argc, char *argv[])
9ddfc2
 			&th_attr_detached, detached_thread_stack_size)) {
9ddfc2
 		logerr("%s: failed to set stack size thread attribute!",
9ddfc2
 		       program);
9ddfc2
-		res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
-		close(start_pipefd[1]);
9ddfc2
+		if (start_pipefd[1] != -1) {
9ddfc2
+			res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
+			close(start_pipefd[1]);
9ddfc2
+		}
9ddfc2
 		release_flag_file();
9ddfc2
 		macro_free_global_table();
9ddfc2
 		exit(1);
9ddfc2
@@ -2500,8 +2511,10 @@ int main(int argc, char *argv[])
9ddfc2
 			&th_attr_detached, &detached_thread_stack_size)) {
9ddfc2
 		logerr("%s: failed to get detached thread stack size!",
9ddfc2
 		       program);
9ddfc2
-		res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
-		close(start_pipefd[1]);
9ddfc2
+		if (start_pipefd[1] != -1) {
9ddfc2
+			res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
+			close(start_pipefd[1]);
9ddfc2
+		}
9ddfc2
 		release_flag_file();
9ddfc2
 		macro_free_global_table();
9ddfc2
 		exit(1);
9ddfc2
@@ -2518,8 +2531,10 @@ int main(int argc, char *argv[])
9ddfc2
 		logerr("%s: failed to create thread data key for std env vars!",
9ddfc2
 		       program);
9ddfc2
 		master_kill(master_list);
9ddfc2
-		res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
-		close(start_pipefd[1]);
9ddfc2
+		if (start_pipefd[1] != -1) {
9ddfc2
+			res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
+			close(start_pipefd[1]);
9ddfc2
+		}
9ddfc2
 		release_flag_file();
9ddfc2
 		macro_free_global_table();
9ddfc2
 		exit(1);
9ddfc2
@@ -2530,8 +2545,10 @@ int main(int argc, char *argv[])
9ddfc2
 		logerr("%s: failed to create thread data key for attempt ID!",
9ddfc2
 		       program);
9ddfc2
 		master_kill(master_list);
9ddfc2
-		res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
-		close(start_pipefd[1]);
9ddfc2
+		if (start_pipefd[1] != -1) {
9ddfc2
+			res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
+			close(start_pipefd[1]);
9ddfc2
+		}
9ddfc2
 		release_flag_file();
9ddfc2
 		macro_free_global_table();
9ddfc2
 		exit(1);
9ddfc2
@@ -2542,8 +2559,10 @@ int main(int argc, char *argv[])
9ddfc2
 	if (!alarm_start_handler()) {
9ddfc2
 		logerr("%s: failed to create alarm handler thread!", program);
9ddfc2
 		master_kill(master_list);
9ddfc2
-		res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
-		close(start_pipefd[1]);
9ddfc2
+		if (start_pipefd[1] != -1) {
9ddfc2
+			res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
+			close(start_pipefd[1]);
9ddfc2
+		}
9ddfc2
 		release_flag_file();
9ddfc2
 		macro_free_global_table();
9ddfc2
 		exit(1);
9ddfc2
@@ -2552,8 +2571,10 @@ int main(int argc, char *argv[])
9ddfc2
 	if (!st_start_handler()) {
9ddfc2
 		logerr("%s: failed to create FSM handler thread!", program);
9ddfc2
 		master_kill(master_list);
9ddfc2
-		res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
-		close(start_pipefd[1]);
9ddfc2
+		if (start_pipefd[1] != -1) {
9ddfc2
+			res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
+			close(start_pipefd[1]);
9ddfc2
+		}
9ddfc2
 		release_flag_file();
9ddfc2
 		macro_free_global_table();
9ddfc2
 		exit(1);
9ddfc2
@@ -2599,9 +2620,15 @@ int main(int argc, char *argv[])
9ddfc2
 	 */
9ddfc2
 	do_force_unlink = 0;
9ddfc2
 
9ddfc2
-	st_stat = 0;
9ddfc2
-	res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
-	close(start_pipefd[1]);
9ddfc2
+	if (start_pipefd[1] != -1) {
9ddfc2
+		st_stat = 0;
9ddfc2
+		res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
9ddfc2
+		close(start_pipefd[1]);
9ddfc2
+	}
9ddfc2
+
9ddfc2
+#ifdef WITH_SYSTEMD
9ddfc2
+	sd_notify(1, "READY=1");
9ddfc2
+#endif
9ddfc2
 
9ddfc2
 	state_mach_thid = pthread_self();
9ddfc2
 	statemachine(NULL);
9ddfc2
--- autofs-5.0.7.orig/samples/autofs.service.in
9ddfc2
+++ autofs-5.0.7/samples/autofs.service.in
9ddfc2
@@ -4,10 +4,9 @@ After=network.target ypbind.service sssd
9ddfc2
 Wants=network-online.target rpc-statd.service rpcbind.service
9ddfc2
 
9ddfc2
 [Service]
9ddfc2
-Type=forking
9ddfc2
-PIDFile=@@autofspiddir@@/autofs.pid
9ddfc2
+Type=notify
9ddfc2
 EnvironmentFile=-@@autofsconfdir@@/autofs
9ddfc2
-ExecStart=@@sbindir@@/automount $OPTIONS --pid-file @@autofspiddir@@/autofs.pid
9ddfc2
+ExecStart=@@sbindir@@/automount $OPTIONS --foreground --dont-check-daemon
9ddfc2
 ExecReload=/usr/bin/kill -HUP $MAINPID
9ddfc2
 KillMode=process
9ddfc2
 TimeoutSec=180
9ddfc2
--- autofs-5.0.7.orig/configure
9ddfc2
+++ autofs-5.0.7/configure
9ddfc2
@@ -672,6 +672,10 @@ HAVE_MOUNT
9ddfc2
 MOUNT
9ddfc2
 DMALLOCLIB
9ddfc2
 TIRPCLIB
9ddfc2
+flagdir
9ddfc2
+fifodir
9ddfc2
+mapdir
9ddfc2
+confdir
9ddfc2
 OBJEXT
9ddfc2
 EXEEXT
9ddfc2
 ac_ct_CC
9ddfc2
@@ -679,11 +683,13 @@ CPPFLAGS
9ddfc2
 LDFLAGS
9ddfc2
 CFLAGS
9ddfc2
 CC
9ddfc2
-flagdir
9ddfc2
-fifodir
9ddfc2
-mapdir
9ddfc2
-confdir
9ddfc2
+systemd_LIBS
9ddfc2
+systemd_CFLAGS
9ddfc2
+WITH_SYSTEMD
9ddfc2
 systemddir
9ddfc2
+PKG_CONFIG_LIBDIR
9ddfc2
+PKG_CONFIG_PATH
9ddfc2
+PKG_CONFIG
9ddfc2
 piddir
9ddfc2
 initdir
9ddfc2
 target_alias
9ddfc2
@@ -748,6 +754,11 @@ enable_limit_getgrgid_size
9ddfc2
       ac_precious_vars='build_alias
9ddfc2
 host_alias
9ddfc2
 target_alias
9ddfc2
+PKG_CONFIG
9ddfc2
+PKG_CONFIG_PATH
9ddfc2
+PKG_CONFIG_LIBDIR
9ddfc2
+systemd_CFLAGS
9ddfc2
+systemd_LIBS
9ddfc2
 CC
9ddfc2
 CFLAGS
9ddfc2
 LDFLAGS
9ddfc2
@@ -1388,6 +1399,15 @@ Optional Packages:
9ddfc2
   --with-sasl=DIR	  enable SASL support for LDAP maps (libs and includes in DIR)
9ddfc2
 
9ddfc2
 Some influential environment variables:
9ddfc2
+  PKG_CONFIG  path to pkg-config utility
9ddfc2
+  PKG_CONFIG_PATH
9ddfc2
+              directories to add to pkg-config's search path
9ddfc2
+  PKG_CONFIG_LIBDIR
9ddfc2
+              path overriding pkg-config's built-in search path
9ddfc2
+  systemd_CFLAGS
9ddfc2
+              C compiler flags for systemd, overriding pkg-config
9ddfc2
+  systemd_LIBS
9ddfc2
+              linker flags for systemd, overriding pkg-config
9ddfc2
   CC          C compiler command
9ddfc2
   CFLAGS      C compiler flags
9ddfc2
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
9ddfc2
@@ -2161,6 +2181,31 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
9ddfc2
 
9ddfc2
 
9ddfc2
 
9ddfc2
+# for pkg-config macros
9ddfc2
+# pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
9ddfc2
+# serial 11 (pkg-config-0.29.1)
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
 #
9ddfc2
 # autofs installs by default in /usr
9ddfc2
 #
9ddfc2
@@ -2236,6 +2281,126 @@ if test -z "$piddir"; then
9ddfc2
 fi
9ddfc2
 
9ddfc2
 
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9ddfc2
+	if test -n "$ac_tool_prefix"; then
9ddfc2
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
9ddfc2
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
9ddfc2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9ddfc2
+$as_echo_n "checking for $ac_word... " >&6; }
9ddfc2
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
9ddfc2
+  $as_echo_n "(cached) " >&6
9ddfc2
+else
9ddfc2
+  case $PKG_CONFIG in
9ddfc2
+  [\\/]* | ?:[\\/]*)
9ddfc2
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
9ddfc2
+  ;;
9ddfc2
+  *)
9ddfc2
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9ddfc2
+for as_dir in $PATH
9ddfc2
+do
9ddfc2
+  IFS=$as_save_IFS
9ddfc2
+  test -z "$as_dir" && as_dir=.
9ddfc2
+    for ac_exec_ext in '' $ac_executable_extensions; do
9ddfc2
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9ddfc2
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
9ddfc2
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9ddfc2
+    break 2
9ddfc2
+  fi
9ddfc2
+done
9ddfc2
+  done
9ddfc2
+IFS=$as_save_IFS
9ddfc2
+
9ddfc2
+  ;;
9ddfc2
+esac
9ddfc2
+fi
9ddfc2
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
9ddfc2
+if test -n "$PKG_CONFIG"; then
9ddfc2
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
9ddfc2
+$as_echo "$PKG_CONFIG" >&6; }
9ddfc2
+else
9ddfc2
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9ddfc2
+$as_echo "no" >&6; }
9ddfc2
+fi
9ddfc2
+
9ddfc2
+
9ddfc2
+fi
9ddfc2
+if test -z "$ac_cv_path_PKG_CONFIG"; then
9ddfc2
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
9ddfc2
+  # Extract the first word of "pkg-config", so it can be a program name with args.
9ddfc2
+set dummy pkg-config; ac_word=$2
9ddfc2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
9ddfc2
+$as_echo_n "checking for $ac_word... " >&6; }
9ddfc2
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
9ddfc2
+  $as_echo_n "(cached) " >&6
9ddfc2
+else
9ddfc2
+  case $ac_pt_PKG_CONFIG in
9ddfc2
+  [\\/]* | ?:[\\/]*)
9ddfc2
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
9ddfc2
+  ;;
9ddfc2
+  *)
9ddfc2
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
9ddfc2
+for as_dir in $PATH
9ddfc2
+do
9ddfc2
+  IFS=$as_save_IFS
9ddfc2
+  test -z "$as_dir" && as_dir=.
9ddfc2
+    for ac_exec_ext in '' $ac_executable_extensions; do
9ddfc2
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9ddfc2
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
9ddfc2
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
9ddfc2
+    break 2
9ddfc2
+  fi
9ddfc2
+done
9ddfc2
+  done
9ddfc2
+IFS=$as_save_IFS
9ddfc2
+
9ddfc2
+  ;;
9ddfc2
+esac
9ddfc2
+fi
9ddfc2
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
9ddfc2
+if test -n "$ac_pt_PKG_CONFIG"; then
9ddfc2
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
9ddfc2
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
9ddfc2
+else
9ddfc2
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9ddfc2
+$as_echo "no" >&6; }
9ddfc2
+fi
9ddfc2
+
9ddfc2
+  if test "x$ac_pt_PKG_CONFIG" = x; then
9ddfc2
+    PKG_CONFIG=""
9ddfc2
+  else
9ddfc2
+    case $cross_compiling:$ac_tool_warned in
9ddfc2
+yes:)
9ddfc2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
9ddfc2
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
9ddfc2
+ac_tool_warned=yes ;;
9ddfc2
+esac
9ddfc2
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
9ddfc2
+  fi
9ddfc2
+else
9ddfc2
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
9ddfc2
+fi
9ddfc2
+
9ddfc2
+fi
9ddfc2
+if test -n "$PKG_CONFIG"; then
9ddfc2
+	_pkg_min_version=0.9.0
9ddfc2
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
9ddfc2
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
9ddfc2
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9ddfc2
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
9ddfc2
+$as_echo "yes" >&6; }
9ddfc2
+	else
9ddfc2
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9ddfc2
+$as_echo "no" >&6; }
9ddfc2
+		PKG_CONFIG=""
9ddfc2
+	fi
9ddfc2
+fi
9ddfc2
+
9ddfc2
 #
9ddfc2
 # Check for systemd unit files direectory exists if unit file installation
9ddfc2
 # is requested
9ddfc2
@@ -2255,9 +2420,11 @@ $as_echo_n "checking location of the sys
9ddfc2
       fi
9ddfc2
     done
9ddfc2
   fi
9ddfc2
+  WITH_SYSTEMD=0
9ddfc2
   if test -n "$systemddir"; then
9ddfc2
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $systemddir" >&5
9ddfc2
 $as_echo "$systemddir" >&6; }
9ddfc2
+    WITH_SYSTEMD=1
9ddfc2
   else
9ddfc2
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
9ddfc2
 $as_echo "not found" >&6; }
9ddfc2
@@ -2268,129 +2435,6 @@ fi
9ddfc2
 
9ddfc2
 
9ddfc2
 
9ddfc2
-#
9ddfc2
-# Location of system config script directory?
9ddfc2
-#
9ddfc2
-if test -z "$confdir"; then
9ddfc2
-  for conf_d in /etc/sysconfig /etc/defaults /etc/conf.d /etc/default; do
9ddfc2
-    if test -z "$confdir"; then
9ddfc2
-      if test -d "$conf_d"; then
9ddfc2
-	confdir="$conf_d"
9ddfc2
-      fi
9ddfc2
-    fi
9ddfc2
-  done
9ddfc2
-fi
9ddfc2
-
9ddfc2
-# Check whether --with-confdir was given.
9ddfc2
-if test "${with_confdir+set}" = set; then :
9ddfc2
-  withval=$with_confdir; if test -z "$withval" -o "$withval" = "yes" -o "$withval" = "no"
9ddfc2
-	then
9ddfc2
-		:
9ddfc2
-	else
9ddfc2
-		confdir="${withval}"
9ddfc2
-	fi
9ddfc2
-
9ddfc2
-fi
9ddfc2
-
9ddfc2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for autofs configuration file directory" >&5
9ddfc2
-$as_echo_n "checking for autofs configuration file directory... " >&6; }
9ddfc2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $confdir" >&5
9ddfc2
-$as_echo "$confdir" >&6; }
9ddfc2
-
9ddfc2
-
9ddfc2
-#
9ddfc2
-# The user can specify --with-mapsdir=PATH to specify autofs maps go
9ddfc2
-#
9ddfc2
-if test -z "$mapdir"; then
9ddfc2
-  for map_d in /etc/autofs /etc; do
9ddfc2
-    if test -z "$mapdir"; then
9ddfc2
-      if test -d "$map_d"; then
9ddfc2
-	mapdir="$map_d"
9ddfc2
-      fi
9ddfc2
-    fi
9ddfc2
-  done
9ddfc2
-fi
9ddfc2
-
9ddfc2
-# Check whether --with-mapdir was given.
9ddfc2
-if test "${with_mapdir+set}" = set; then :
9ddfc2
-  withval=$with_mapdir; if test -z "$withval" -o "$withval" = "yes" -o "$withval" = "no"
9ddfc2
-	then
9ddfc2
-		:
9ddfc2
-	else
9ddfc2
-		mapdir="${withval}"
9ddfc2
-	fi
9ddfc2
-
9ddfc2
-fi
9ddfc2
-
9ddfc2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for autofs maps directory" >&5
9ddfc2
-$as_echo_n "checking for autofs maps directory... " >&6; }
9ddfc2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $mapdir" >&5
9ddfc2
-$as_echo "$mapdir" >&6; }
9ddfc2
-
9ddfc2
-
9ddfc2
-#
9ddfc2
-# The user can specify --with-fifodir=PATH to specify where autofs fifos go
9ddfc2
-#
9ddfc2
-if test -z "$fifodir"; then
9ddfc2
-  for fifo_d in /run /var/run /tmp; do
9ddfc2
-    if test -z "$fifodir"; then
9ddfc2
-      if test -d "$fifo_d"; then
9ddfc2
-        fifodir="$fifo_d"
9ddfc2
-      fi
9ddfc2
-    fi
9ddfc2
-  done
9ddfc2
-fi
9ddfc2
-
9ddfc2
-# Check whether --with-fifodir was given.
9ddfc2
-if test "${with_fifodir+set}" = set; then :
9ddfc2
-  withval=$with_fifodir; if test -z "$withval" -o "$withval" = "yes" -o "$withval" = "no"
9ddfc2
-	then
9ddfc2
-		:
9ddfc2
-	else
9ddfc2
-		fifodir="${withval}"
9ddfc2
-	fi
9ddfc2
-
9ddfc2
-fi
9ddfc2
-
9ddfc2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for autofs fifos directory" >&5
9ddfc2
-$as_echo_n "checking for autofs fifos directory... " >&6; }
9ddfc2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fifodir" >&5
9ddfc2
-$as_echo "$fifodir" >&6; }
9ddfc2
-
9ddfc2
-
9ddfc2
-#
9ddfc2
-# The user can specify --with-flagdir=PATH to specify where autofs flag file goes
9ddfc2
-#
9ddfc2
-if test -z "$flagdir"; then
9ddfc2
-  for flag_d in /run /var/run /tmp; do
9ddfc2
-    if test -z "$flagdir"; then
9ddfc2
-      if test -d "$flag_d"; then
9ddfc2
-        flagdir="$flag_d"
9ddfc2
-      fi
9ddfc2
-    fi
9ddfc2
-  done
9ddfc2
-fi
9ddfc2
-
9ddfc2
-# Check whether --with-flagdir was given.
9ddfc2
-if test "${with_flagdir+set}" = set; then :
9ddfc2
-  withval=$with_flagdir; if test -z "$withval" -o "$withval" = "yes" -o "$withval" = "no"
9ddfc2
-	then
9ddfc2
-		:
9ddfc2
-	else
9ddfc2
-		filagdir="${withval}"
9ddfc2
-	fi
9ddfc2
-
9ddfc2
-fi
9ddfc2
-
9ddfc2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for autofs flag file directory" >&5
9ddfc2
-$as_echo_n "checking for autofs flag file directory... " >&6; }
9ddfc2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $flagdir" >&5
9ddfc2
-$as_echo "$flagdir" >&6; }
9ddfc2
-
9ddfc2
-
9ddfc2
-#
9ddfc2
-# Use libtirpc
9ddfc2
-#
9ddfc2
 ac_ext=c
9ddfc2
 ac_cpp='$CPP $CPPFLAGS'
9ddfc2
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
9ddfc2
@@ -3181,6 +3225,285 @@ ac_link='$CC -o conftest$ac_exeext $CFLA
9ddfc2
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
9ddfc2
 
9ddfc2
 
9ddfc2
+
9ddfc2
+pkg_failed=no
9ddfc2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for systemd" >&5
9ddfc2
+$as_echo_n "checking for systemd... " >&6; }
9ddfc2
+
9ddfc2
+if test -n "$systemd_CFLAGS"; then
9ddfc2
+    pkg_cv_systemd_CFLAGS="$systemd_CFLAGS"
9ddfc2
+ elif test -n "$PKG_CONFIG"; then
9ddfc2
+    if test -n "$PKG_CONFIG" && \
9ddfc2
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd\""; } >&5
9ddfc2
+  ($PKG_CONFIG --exists --print-errors "libsystemd") 2>&5
9ddfc2
+  ac_status=$?
9ddfc2
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
9ddfc2
+  test $ac_status = 0; }; then
9ddfc2
+  pkg_cv_systemd_CFLAGS=`$PKG_CONFIG --cflags "libsystemd" 2>/dev/null`
9ddfc2
+		      test "x$?" != "x0" && pkg_failed=yes
9ddfc2
+else
9ddfc2
+  pkg_failed=yes
9ddfc2
+fi
9ddfc2
+ else
9ddfc2
+    pkg_failed=untried
9ddfc2
+fi
9ddfc2
+if test -n "$systemd_LIBS"; then
9ddfc2
+    pkg_cv_systemd_LIBS="$systemd_LIBS"
9ddfc2
+ elif test -n "$PKG_CONFIG"; then
9ddfc2
+    if test -n "$PKG_CONFIG" && \
9ddfc2
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd\""; } >&5
9ddfc2
+  ($PKG_CONFIG --exists --print-errors "libsystemd") 2>&5
9ddfc2
+  ac_status=$?
9ddfc2
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
9ddfc2
+  test $ac_status = 0; }; then
9ddfc2
+  pkg_cv_systemd_LIBS=`$PKG_CONFIG --libs "libsystemd" 2>/dev/null`
9ddfc2
+		      test "x$?" != "x0" && pkg_failed=yes
9ddfc2
+else
9ddfc2
+  pkg_failed=yes
9ddfc2
+fi
9ddfc2
+ else
9ddfc2
+    pkg_failed=untried
9ddfc2
+fi
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+if test $pkg_failed = yes; then
9ddfc2
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9ddfc2
+$as_echo "no" >&6; }
9ddfc2
+
9ddfc2
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9ddfc2
+        _pkg_short_errors_supported=yes
9ddfc2
+else
9ddfc2
+        _pkg_short_errors_supported=no
9ddfc2
+fi
9ddfc2
+        if test $_pkg_short_errors_supported = yes; then
9ddfc2
+	        systemd_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd" 2>&1`
9ddfc2
+        else
9ddfc2
+	        systemd_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd" 2>&1`
9ddfc2
+        fi
9ddfc2
+	# Put the nasty error message in config.log where it belongs
9ddfc2
+	echo "$systemd_PKG_ERRORS" >&5
9ddfc2
+
9ddfc2
+
9ddfc2
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sm_notify in -lsystemd" >&5
9ddfc2
+$as_echo_n "checking for sm_notify in -lsystemd... " >&6; }
9ddfc2
+if ${ac_cv_lib_systemd_sm_notify+:} false; then :
9ddfc2
+  $as_echo_n "(cached) " >&6
9ddfc2
+else
9ddfc2
+  ac_check_lib_save_LIBS=$LIBS
9ddfc2
+LIBS="-lsystemd  $LIBS"
9ddfc2
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9ddfc2
+/* end confdefs.h.  */
9ddfc2
+
9ddfc2
+/* Override any GCC internal prototype to avoid an error.
9ddfc2
+   Use char because int might match the return type of a GCC
9ddfc2
+   builtin and then its argument prototype would still apply.  */
9ddfc2
+#ifdef __cplusplus
9ddfc2
+extern "C"
9ddfc2
+#endif
9ddfc2
+char sm_notify ();
9ddfc2
+int
9ddfc2
+main ()
9ddfc2
+{
9ddfc2
+return sm_notify ();
9ddfc2
+  ;
9ddfc2
+  return 0;
9ddfc2
+}
9ddfc2
+_ACEOF
9ddfc2
+if ac_fn_c_try_link "$LINENO"; then :
9ddfc2
+  ac_cv_lib_systemd_sm_notify=yes
9ddfc2
+else
9ddfc2
+  ac_cv_lib_systemd_sm_notify=no
9ddfc2
+fi
9ddfc2
+rm -f core conftest.err conftest.$ac_objext \
9ddfc2
+    conftest$ac_exeext conftest.$ac_ext
9ddfc2
+LIBS=$ac_check_lib_save_LIBS
9ddfc2
+fi
9ddfc2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_systemd_sm_notify" >&5
9ddfc2
+$as_echo "$ac_cv_lib_systemd_sm_notify" >&6; }
9ddfc2
+if test "x$ac_cv_lib_systemd_sm_notify" = xyes; then :
9ddfc2
+  systemd_LIBS="-lsystemd"
9ddfc2
+fi
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+elif test $pkg_failed = untried; then
9ddfc2
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9ddfc2
+$as_echo "no" >&6; }
9ddfc2
+
9ddfc2
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sm_notify in -lsystemd" >&5
9ddfc2
+$as_echo_n "checking for sm_notify in -lsystemd... " >&6; }
9ddfc2
+if ${ac_cv_lib_systemd_sm_notify+:} false; then :
9ddfc2
+  $as_echo_n "(cached) " >&6
9ddfc2
+else
9ddfc2
+  ac_check_lib_save_LIBS=$LIBS
9ddfc2
+LIBS="-lsystemd  $LIBS"
9ddfc2
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9ddfc2
+/* end confdefs.h.  */
9ddfc2
+
9ddfc2
+/* Override any GCC internal prototype to avoid an error.
9ddfc2
+   Use char because int might match the return type of a GCC
9ddfc2
+   builtin and then its argument prototype would still apply.  */
9ddfc2
+#ifdef __cplusplus
9ddfc2
+extern "C"
9ddfc2
+#endif
9ddfc2
+char sm_notify ();
9ddfc2
+int
9ddfc2
+main ()
9ddfc2
+{
9ddfc2
+return sm_notify ();
9ddfc2
+  ;
9ddfc2
+  return 0;
9ddfc2
+}
9ddfc2
+_ACEOF
9ddfc2
+if ac_fn_c_try_link "$LINENO"; then :
9ddfc2
+  ac_cv_lib_systemd_sm_notify=yes
9ddfc2
+else
9ddfc2
+  ac_cv_lib_systemd_sm_notify=no
9ddfc2
+fi
9ddfc2
+rm -f core conftest.err conftest.$ac_objext \
9ddfc2
+    conftest$ac_exeext conftest.$ac_ext
9ddfc2
+LIBS=$ac_check_lib_save_LIBS
9ddfc2
+fi
9ddfc2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_systemd_sm_notify" >&5
9ddfc2
+$as_echo "$ac_cv_lib_systemd_sm_notify" >&6; }
9ddfc2
+if test "x$ac_cv_lib_systemd_sm_notify" = xyes; then :
9ddfc2
+  systemd_LIBS="-lsystemd"
9ddfc2
+fi
9ddfc2
+
9ddfc2
+
9ddfc2
+
9ddfc2
+else
9ddfc2
+	systemd_CFLAGS=$pkg_cv_systemd_CFLAGS
9ddfc2
+	systemd_LIBS=$pkg_cv_systemd_LIBS
9ddfc2
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
9ddfc2
+$as_echo "yes" >&6; }
9ddfc2
+
9ddfc2
+fi
9ddfc2
+
9ddfc2
+#
9ddfc2
+# Location of system config script directory?
9ddfc2
+#
9ddfc2
+if test -z "$confdir"; then
9ddfc2
+  for conf_d in /etc/sysconfig /etc/defaults /etc/conf.d /etc/default; do
9ddfc2
+    if test -z "$confdir"; then
9ddfc2
+      if test -d "$conf_d"; then
9ddfc2
+	confdir="$conf_d"
9ddfc2
+      fi
9ddfc2
+    fi
9ddfc2
+  done
9ddfc2
+fi
9ddfc2
+
9ddfc2
+# Check whether --with-confdir was given.
9ddfc2
+if test "${with_confdir+set}" = set; then :
9ddfc2
+  withval=$with_confdir; if test -z "$withval" -o "$withval" = "yes" -o "$withval" = "no"
9ddfc2
+	then
9ddfc2
+		:
9ddfc2
+	else
9ddfc2
+		confdir="${withval}"
9ddfc2
+	fi
9ddfc2
+
9ddfc2
+fi
9ddfc2
+
9ddfc2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for autofs configuration file directory" >&5
9ddfc2
+$as_echo_n "checking for autofs configuration file directory... " >&6; }
9ddfc2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $confdir" >&5
9ddfc2
+$as_echo "$confdir" >&6; }
9ddfc2
+
9ddfc2
+
9ddfc2
+#
9ddfc2
+# The user can specify --with-mapsdir=PATH to specify autofs maps go
9ddfc2
+#
9ddfc2
+if test -z "$mapdir"; then
9ddfc2
+  for map_d in /etc/autofs /etc; do
9ddfc2
+    if test -z "$mapdir"; then
9ddfc2
+      if test -d "$map_d"; then
9ddfc2
+	mapdir="$map_d"
9ddfc2
+      fi
9ddfc2
+    fi
9ddfc2
+  done
9ddfc2
+fi
9ddfc2
+
9ddfc2
+# Check whether --with-mapdir was given.
9ddfc2
+if test "${with_mapdir+set}" = set; then :
9ddfc2
+  withval=$with_mapdir; if test -z "$withval" -o "$withval" = "yes" -o "$withval" = "no"
9ddfc2
+	then
9ddfc2
+		:
9ddfc2
+	else
9ddfc2
+		mapdir="${withval}"
9ddfc2
+	fi
9ddfc2
+
9ddfc2
+fi
9ddfc2
+
9ddfc2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for autofs maps directory" >&5
9ddfc2
+$as_echo_n "checking for autofs maps directory... " >&6; }
9ddfc2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $mapdir" >&5
9ddfc2
+$as_echo "$mapdir" >&6; }
9ddfc2
+
9ddfc2
+
9ddfc2
+#
9ddfc2
+# The user can specify --with-fifodir=PATH to specify where autofs fifos go
9ddfc2
+#
9ddfc2
+if test -z "$fifodir"; then
9ddfc2
+  for fifo_d in /run /var/run /tmp; do
9ddfc2
+    if test -z "$fifodir"; then
9ddfc2
+      if test -d "$fifo_d"; then
9ddfc2
+        fifodir="$fifo_d"
9ddfc2
+      fi
9ddfc2
+    fi
9ddfc2
+  done
9ddfc2
+fi
9ddfc2
+
9ddfc2
+# Check whether --with-fifodir was given.
9ddfc2
+if test "${with_fifodir+set}" = set; then :
9ddfc2
+  withval=$with_fifodir; if test -z "$withval" -o "$withval" = "yes" -o "$withval" = "no"
9ddfc2
+	then
9ddfc2
+		:
9ddfc2
+	else
9ddfc2
+		fifodir="${withval}"
9ddfc2
+	fi
9ddfc2
+
9ddfc2
+fi
9ddfc2
+
9ddfc2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for autofs fifos directory" >&5
9ddfc2
+$as_echo_n "checking for autofs fifos directory... " >&6; }
9ddfc2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fifodir" >&5
9ddfc2
+$as_echo "$fifodir" >&6; }
9ddfc2
+
9ddfc2
+
9ddfc2
+#
9ddfc2
+# The user can specify --with-flagdir=PATH to specify where autofs flag file goes
9ddfc2
+#
9ddfc2
+if test -z "$flagdir"; then
9ddfc2
+  for flag_d in /run /var/run /tmp; do
9ddfc2
+    if test -z "$flagdir"; then
9ddfc2
+      if test -d "$flag_d"; then
9ddfc2
+        flagdir="$flag_d"
9ddfc2
+      fi
9ddfc2
+    fi
9ddfc2
+  done
9ddfc2
+fi
9ddfc2
+
9ddfc2
+# Check whether --with-flagdir was given.
9ddfc2
+if test "${with_flagdir+set}" = set; then :
9ddfc2
+  withval=$with_flagdir; if test -z "$withval" -o "$withval" = "yes" -o "$withval" = "no"
9ddfc2
+	then
9ddfc2
+		:
9ddfc2
+	else
9ddfc2
+		filagdir="${withval}"
9ddfc2
+	fi
9ddfc2
+
9ddfc2
+fi
9ddfc2
+
9ddfc2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for autofs flag file directory" >&5
9ddfc2
+$as_echo_n "checking for autofs flag file directory... " >&6; }
9ddfc2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $flagdir" >&5
9ddfc2
+$as_echo "$flagdir" >&6; }
9ddfc2
+
9ddfc2
+
9ddfc2
+#
9ddfc2
+# Use libtirpc
9ddfc2
+#
9ddfc2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtirpc is requested and available" >&5
9ddfc2
 $as_echo_n "checking if libtirpc is requested and available... " >&6; }
9ddfc2
 
9ddfc2
--- autofs-5.0.7.orig/aclocal.m4
9ddfc2
+++ autofs-5.0.7/aclocal.m4
9ddfc2
@@ -242,8 +242,10 @@ AC_DEFUN([AF_WITH_SYSTEMD],
9ddfc2
       fi
9ddfc2
     done
9ddfc2
   fi
9ddfc2
+  WITH_SYSTEMD=0
9ddfc2
   if test -n "$systemddir"; then
9ddfc2
     AC_MSG_RESULT($systemddir)
9ddfc2
+    WITH_SYSTEMD=1
9ddfc2
   else
9ddfc2
     AC_MSG_RESULT(not found)
9ddfc2
   fi