diff --git a/configure b/configure index 134bceeb..0fc76ee5 100755 --- a/configure +++ b/configure @@ -648,6 +648,8 @@ ac_includes_default="\ ac_header_c_list= ac_subst_vars='LTLIBOBJS LIBOBJS +CLICON_GROUP +CLICON_USER CLIGEN_DIR WC_BIN TAIL_BIN @@ -768,6 +770,8 @@ with_libxml2 with_sigaction with_yang_installdir with_yang_standard_dir +with_clicon_user +with_clicon_group enable_nls ' ac_precious_vars='build_alias @@ -1440,6 +1444,9 @@ Optional Packages: --with-yang-standard-dir=DIR Directory of standard IETF/IEEE YANG specs (default: $prefix/share/yang/standard) + --with-clicon-user=user Run as this user in configuration files + --with-clicon-group=group + Run as this group in configuration files Some influential environment variables: CC C compiler command @@ -6876,6 +6883,37 @@ fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Standard YANG files expected to be in ${YANG_STANDARD_DIR}" >&5 printf "%s\n" "Standard YANG files expected to be in ${YANG_STANDARD_DIR}" >&6; } +# who we run as in our examples and tests +CLICON_USER="clicon" + +# Check whether --with-clicon-user was given. +if test ${with_clicon_user+y} +then : + withval=$with_clicon_user; + CLICON_USER="$withval" + +fi + + +if test -n "${CLICON_USER}"; then + echo "Using CLICON_USER here: ${CLICON_USER}" +fi + +CLICON_GROUP="clicon" + +# Check whether --with-clicon-group was given. +if test ${with_clicon_group+y} +then : + withval=$with_clicon_group; + CLICON_GROUP="$withval" + +fi + + +if test -n "${CLICON_GROUP}"; then + echo "Using CLICON_GROUP here: ${CLICON_GROUP}" +fi + # Default location for config file printf "%s\n" "#define CLIXON_DEFAULT_CONFIG \"${CLIXON_DEFAULT_CONFIG}\"" >>confdefs.h diff --git a/configure.ac b/configure.ac index 30af6071..81dcec98 100644 --- a/configure.ac +++ b/configure.ac @@ -413,6 +413,25 @@ AC_ARG_WITH(yang-standard-dir, ) AC_MSG_RESULT(Standard YANG files expected to be in ${YANG_STANDARD_DIR}) +# who we run as in our examples and tests +CLICON_USER="clicon" +AC_ARG_WITH([clicon-user], [AS_HELP_STRING([--with-clicon-user=user], [Run as this user in configuration files])], [ + CLICON_USER="$withval" +]) +AC_SUBST(CLICON_USER) +if test -n "${CLICON_USER}"; then + echo "Using CLICON_USER here: ${CLICON_USER}" +fi + +CLICON_GROUP="clicon" +AC_ARG_WITH([clicon-group], [AS_HELP_STRING([--with-clicon-group=group], [Run as this group in configuration files])], [ + CLICON_GROUP="$withval" +]) +AC_SUBST(CLICON_GROUP) +if test -n "${CLICON_GROUP}"; then + echo "Using CLICON_GROUP here: ${CLICON_GROUP}" +fi + # Default location for config file AC_DEFINE_UNQUOTED(CLIXON_DEFAULT_CONFIG,"${CLIXON_DEFAULT_CONFIG}",[Location for apps to find default config file]) diff --git a/example/main/example.xml.in b/example/main/example.xml.in index bf07ab87..4fd5bfd1 100644 --- a/example/main/example.xml.in +++ b/example/main/example.xml.in @@ -11,9 +11,11 @@ @LIBDIR@/example/backend @LIBDIR@/example/netconf @LIBDIR@/example/restconf + @CLICON_USER@ @LIBDIR@/example/cli @LIBDIR@/example/clispec @LOCALSTATEDIR@/run/example.sock + @CLICON_GROUP@ @LOCALSTATEDIR@/run/example.pid 0 0