introduce nscd --foreground, for systemd use
Alexandre Oliva
aoliva@redhat.com
Tue Jan 31 01:45:00 GMT 2012
On Jan 23, 2012, Roland McGrath <roland@hack.frob.com> wrote:
> This seems generally sound to me. But I'd like to know if there is
> any existing precedent for an option letter and/or long option name
> for doing this in another GNU utility.
I'm afraid I couldn't find examples of programs that offered this level
of flexibility, so I saught guidance in the GNU coding standards.
http://www.gnu.org/prep/standards/standards.html#Option-Table
‘foreground’
For server programs, run in the foreground; in other words, don’t do
anything special to run the server in the background.
‘debug’
‘-d’ in make and m4; ‘-t’ in Bison.
There doesn't seem to be a standard short option for “--foreground”;
indeed, some non-GNU programs use -d to daemonize, whereas others use it
to enter debugging mode. I couldn't tell (by just looking at remote
docs) whether they changed behavior WRT syslog when they offered both
options. It's a bit of a mess already :-(
> Perhaps cleaner to have two bools.
I've considered adding --[no-]syslog, but we don't really have 4
different possibilities in the choice space. It doesn't make sense to
send output to std* if you daemonize: it's really 3-state.
Or (4-, 5- or) 6-state, if we were to add “paranoid mode” as a
(non-)orthogonal dimension in the choice space.
>> + fprintf (stderr, _("further output sent to syslog\n"));
> What's the point of this message?
It's just so that someone who runs the program in --foreground isn't
surprised by the absence of output when the program runs in foreground,
behavior that is new and unlike that of -d.
> It's not normal for daemon startup to print anything to stderr in my
> experience.
This won't be printed in daemon mode, only in --foreground mode.
--
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist Red Hat Brazil Compiler Engineer
More information about the Libc-alpha
mailing list