Add autoconf handling of clixon user/group in config files

This commit is contained in:
Philip Prindeville 2023-08-15 12:18:46 -06:00 committed by Olof Hagsand
parent 170497b4b6
commit 5919ba6c6a
3 changed files with 59 additions and 0 deletions

38
configure vendored
View file

@ -648,6 +648,8 @@ ac_includes_default="\
ac_header_c_list= ac_header_c_list=
ac_subst_vars='LTLIBOBJS ac_subst_vars='LTLIBOBJS
LIBOBJS LIBOBJS
CLICON_GROUP
CLICON_USER
CLIGEN_DIR CLIGEN_DIR
WC_BIN WC_BIN
TAIL_BIN TAIL_BIN
@ -768,6 +770,8 @@ with_libxml2
with_sigaction with_sigaction
with_yang_installdir with_yang_installdir
with_yang_standard_dir with_yang_standard_dir
with_clicon_user
with_clicon_group
enable_nls enable_nls
' '
ac_precious_vars='build_alias ac_precious_vars='build_alias
@ -1440,6 +1444,9 @@ Optional Packages:
--with-yang-standard-dir=DIR --with-yang-standard-dir=DIR
Directory of standard IETF/IEEE YANG specs (default: Directory of standard IETF/IEEE YANG specs (default:
$prefix/share/yang/standard) $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: Some influential environment variables:
CC C compiler command 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" "$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; } 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 # Default location for config file
printf "%s\n" "#define CLIXON_DEFAULT_CONFIG \"${CLIXON_DEFAULT_CONFIG}\"" >>confdefs.h printf "%s\n" "#define CLIXON_DEFAULT_CONFIG \"${CLIXON_DEFAULT_CONFIG}\"" >>confdefs.h

View file

@ -413,6 +413,25 @@ AC_ARG_WITH(yang-standard-dir,
) )
AC_MSG_RESULT(Standard YANG files expected to be in ${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 # Default location for config file
AC_DEFINE_UNQUOTED(CLIXON_DEFAULT_CONFIG,"${CLIXON_DEFAULT_CONFIG}",[Location for apps to find default config file]) AC_DEFINE_UNQUOTED(CLIXON_DEFAULT_CONFIG,"${CLIXON_DEFAULT_CONFIG}",[Location for apps to find default config file])

View file

@ -11,9 +11,11 @@
<CLICON_BACKEND_DIR>@LIBDIR@/example/backend</CLICON_BACKEND_DIR> <CLICON_BACKEND_DIR>@LIBDIR@/example/backend</CLICON_BACKEND_DIR>
<CLICON_NETCONF_DIR>@LIBDIR@/example/netconf</CLICON_NETCONF_DIR> <CLICON_NETCONF_DIR>@LIBDIR@/example/netconf</CLICON_NETCONF_DIR>
<CLICON_RESTCONF_DIR>@LIBDIR@/example/restconf</CLICON_RESTCONF_DIR> <CLICON_RESTCONF_DIR>@LIBDIR@/example/restconf</CLICON_RESTCONF_DIR>
<CLICON_RESTCONF_USER>@CLICON_USER@</CLICON_RESTCONF_USER>
<CLICON_CLI_DIR>@LIBDIR@/example/cli</CLICON_CLI_DIR> <CLICON_CLI_DIR>@LIBDIR@/example/cli</CLICON_CLI_DIR>
<CLICON_CLISPEC_DIR>@LIBDIR@/example/clispec</CLICON_CLISPEC_DIR> <CLICON_CLISPEC_DIR>@LIBDIR@/example/clispec</CLICON_CLISPEC_DIR>
<CLICON_SOCK>@LOCALSTATEDIR@/run/example.sock</CLICON_SOCK> <CLICON_SOCK>@LOCALSTATEDIR@/run/example.sock</CLICON_SOCK>
<CLICON_SOCK_GROUP>@CLICON_GROUP@</CLICON_SOCK_GROUP>
<CLICON_BACKEND_PIDFILE>@LOCALSTATEDIR@/run/example.pid</CLICON_BACKEND_PIDFILE> <CLICON_BACKEND_PIDFILE>@LOCALSTATEDIR@/run/example.pid</CLICON_BACKEND_PIDFILE>
<CLICON_CLI_LINESCROLLING>0</CLICON_CLI_LINESCROLLING> <CLICON_CLI_LINESCROLLING>0</CLICON_CLI_LINESCROLLING>
<CLICON_CLI_TAB_MODE>0</CLICON_CLI_TAB_MODE> <CLICON_CLI_TAB_MODE>0</CLICON_CLI_TAB_MODE>