[PATCH] Add --foreground option for nscd

Carlos O'Donell carlos@systemhalted.org
Wed May 9 14:50:00 GMT 2012


On Wed, May 9, 2012 at 10:33 AM, Andreas Jaeger <aj@suse.de> wrote:
> Agreed, it's now cleaner ;)
>
> Ok now?
>
> Andreas
>
> 2012-05-09  Alexandre Oliva  <aoliva@redhat.com>
>            Andreas Jaeger  <aj@suse.de>
>
>        * nscd/nscd.c (go_background): Replaced with...
>        (run_mode): ... this.
>        (RUN_FOREGROUND, RUN_DAEMONIZE, RUN_DEBUG): Add.
>        (options): Add -F --foreground.
>        (main): Implement it.
>        (parse_opt): Parse it.

Yes, this code is now easy to understand :-)

One minor nit.

> diff --git a/nscd/nscd.c b/nscd/nscd.c
> index 9cd7273..9f58aad 100644
> --- a/nscd/nscd.c
> +++ b/nscd/nscd.c
> @@ -1,4 +1,4 @@
> -/* Copyright (c) 1998-2011, 2012 Free Software Foundation, Inc.
> +/* Copyright (c) 1998-2012 Free Software Foundation, Inc.
>    This file is part of the GNU C Library.
>    Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998.
>
> @@ -71,7 +71,18 @@ thread_info_t thread_info;
>  int do_shutdown;
>  int disabled_passwd;
>  int disabled_group;
> -int go_background = 1;
> +
> +enum
> +{
> +  /* Running in foreground but otherwise behave like a daemon,
> +     i.e., detach from terminal and use syslog.  */

Expand this comment to say why this mode is useful e.g. We support
integration with service managers like systemd.

OK with that change.

Cheers,
Carlos.



More information about the Libc-alpha mailing list