Hi,

Without getting into the merits of the ticket, I think the headline can be
changed to describe the problem better.
As it stands, it is misleading for a topic such as this.

Cheers,
Mathi.

On Tue, Jul 21, 2020 at 4:41 AM <s.an...@gethighavailability.com> wrote:

> From: Anand Sundararaj <s.an...@gethighavailability.com>
>
> ---
>  src/amf/amfnd/amfnd.conf | 3 +++
>  src/amf/amfnd/main.cc    | 9 ++++++++-
>  2 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/src/amf/amfnd/amfnd.conf b/src/amf/amfnd/amfnd.conf
> index 07bc0ba..4e8b07a 100644
> --- a/src/amf/amfnd/amfnd.conf
> +++ b/src/amf/amfnd/amfnd.conf
> @@ -34,3 +34,6 @@ export AVND_PM_MONITORING_RATE=1000
>  # It can be disabled if set THREAD_TRACE_BUFFER as 0, the maximum value
>  # can be set as 65535.
>  # export THREAD_TRACE_BUFFER=10240
> +
> +#AMFND run as root. Uncomment next line to run as a user mentioned in
> nid.conf.
> +#export AMFND_NON_ROOT=1
> diff --git a/src/amf/amfnd/main.cc b/src/amf/amfnd/main.cc
> index d7857fa..6d9ee95 100644
> --- a/src/amf/amfnd/main.cc
> +++ b/src/amf/amfnd/main.cc
> @@ -164,6 +164,7 @@ static void new_handler() {
>
>  int main(int argc, char *argv[]) {
>    uint32_t error;
> +  char *val;
>
>    // function to be called if new fails. The alternative of using catch of
>    // std::bad_alloc will unwind the stack and thus no call chain will be
> @@ -179,7 +180,13 @@ int main(int argc, char *argv[]) {
>      goto done;
>    }
>
> -  daemonize_as_user("root", argc, argv);
> +  if ((val = getenv("AMFND_NON_ROOT")) != nullptr) {
> +    daemonize(argc, argv);
> +    TRACE("AMFND will run as non-root");
> +  } else {
> +    daemonize_as_user("root", argc, argv);
> +    TRACE("AMFND will run as root");
> +  }
>
>    // Enable long DN
>    if (setenv("SA_ENABLE_EXTENDED_NAMES", "1", 1) != 0) {
> --
> 2.7.4
>
>
>
> _______________________________________________
> Opensaf-devel mailing list
> Opensaf-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/opensaf-devel
>

_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to