[fedfs-utils] [PATCH 8/8] configure.ac: Add a --with-fedfsuser and --with-statedir options

Chuck Lever chuck.lever at oracle.com
Mon Sep 19 15:42:59 PDT 2011


Allow distributions to set the name of the user ID and group ID used
for FedFS system operations, and the directory used to contain TLS
certs and the NSDB parameter database.

Signed-off-by: Chuck Lever <chuck.lever at oracle.com>
---

 configure.ac        |   18 ++++++++++++++++++
 src/include/fedfs.h |   15 ---------------
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/configure.ac b/configure.ac
index 33f94b1..3647dba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,6 +36,24 @@ AC_CONFIG_MACRO_DIR([m4])
 LT_INIT
 AM_INIT_AUTOMAKE
 
+# configure command line options
+AC_ARG_WITH([fedfsuser],
+	[AC_HELP_STRING([--with-fedfsuser=name],
+		[User name to use when dropping privileges @<:@default=fedfs@:>@])],
+	fedfsuser=$withval,
+	fedfsuser=fedfs)
+	AC_SUBST(fedfsuser)
+	AC_DEFINE_UNQUOTED([FEDFS_USER], ["$fedfsuser"],
+		[Define to the user name to use when dropping privileges.])
+AC_ARG_WITH([statedir],
+	[AC_HELP_STRING([--with-statedir=pathname],
+		[Default pathname of directory where fedfsd maintains persistent state @<:@default=/var/lib/fedfs@:>@])],
+	statedir=$withval,
+	statedir=/var/lib/fedfs)
+	AC_SUBST(statedir)
+	AC_DEFINE_UNQUOTED([FEDFS_DEFAULT_STATEDIR], ["$statedir"],
+		[Define to the default pathname of the directory where fedfsd maintains persistent state.])
+
 # Checks for programs.
 AC_PROG_CC
 AC_PROG_INSTALL
diff --git a/src/include/fedfs.h b/src/include/fedfs.h
index 483dda4..9c4670a 100644
--- a/src/include/fedfs.h
+++ b/src/include/fedfs.h
@@ -47,21 +47,6 @@
 #define FEDFS_DATABASE_FILE		"nsdbparam.sqlite3"
 
 /**
- * Default pathname of directory where fedfsd maintains persistent state
- */
-#ifndef FEDFS_DEFAULT_STATEDIR
-#define FEDFS_DEFAULT_STATEDIR		"/var/lib/fedfs"
-#endif	/* FEDFS_DEFAULT_STATEDIR */
-
-/**
- * User name to use when dropping privileges.  This user is
- * typically the owner of default state directory.
- */
-#ifndef FEDFS_USER
-#define FEDFS_USER	"fedfs"
-#endif	/* FEDFS_USER */
-
-/**
  * Initial number of seconds to wait after receiving FEDFS_ERR_DELAY
  */
 #define FEDFS_DELAY_MIN_SECS	2




More information about the fedfs-utils-devel mailing list