diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-10-03 19:33:48 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-10-03 19:33:48 +0000 |
commit | 4401d759051714fcc016a146685f3c13bed49442 (patch) | |
tree | fb2a02b91616e460a2b1fcd6eb482a0b3db9d860 /nscd/nscd_stat.c | |
parent | fc03df7aa6d9de00d09ddaf9c27074fb4ea6d3ef (diff) | |
download | glibc-4401d759051714fcc016a146685f3c13bed49442.zip glibc-4401d759051714fcc016a146685f3c13bed49442.tar.gz glibc-4401d759051714fcc016a146685f3c13bed49442.tar.bz2 |
Update.
Implement paranoia mode.
* nscd/connections.c (nscd_init): Mark database and socket descriptors
as close on exec.
(restart): New function.
(restart_p): New function.
(nscd_run): Add missing descrement of nready in case readylist is
empty.
(main_loop_poll): Call restart_p and restart.
(main_loop_epoll): Likewise.
(begin_drop_privileges): Save original UID and GID.
* nscd/nscd.c: Define new variables paranoia, restart_time,
restart_interval, oldcwd, old_gid, old_uid.
(main): Disable paranoia mode if we are not forking.
(check_pid): When re-execing, the PID file contains the same PID as
the current process. Do not fail in this case.
* nscd/nscd.conf: Add paranoia and restart-interval entries.
* nscd/nscd.h: Define RESTART_INTERVAL. Declare new variables.
* nscd/nscd_conf.c: Parse paranoia and restart-internal configurations.
* nscd/nscd_stat.c: Print paranoia and restart-internal values.
Diffstat (limited to 'nscd/nscd_stat.c')
-rw-r--r-- | nscd/nscd_stat.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/nscd/nscd_stat.c b/nscd/nscd_stat.c index 3e3be5b..a56a381 100644 --- a/nscd/nscd_stat.c +++ b/nscd/nscd_stat.c @@ -143,6 +143,8 @@ receive_print_stats (void) int fd; int i; uid_t uid = getuid (); + const char *yesstr = _(" yes"); + const char *nostr = _(" no"); /* Find out whether there is another user but root allowed to request statistics. */ @@ -223,8 +225,11 @@ receive_print_stats (void) else printf (_(" %2lus server runtime\n"), diff); - printf (_("%15lu number of times clients had to wait\n"), - data.client_queued); + printf (_("%15lu number of times clients had to wait\n" + "%15s paranoia mode enabled\n" + "%15lu restart internal\n"), + data.client_queued, paranoia ? yesstr : nostr, + (unsigned long int) restart_interval); for (i = 0; i < lastdb; ++i) { @@ -241,13 +246,13 @@ receive_print_stats (void) /* The locale does not provide this information so we have to translate it ourself. Since we should avoid short translation terms we artifically increase the length. */ - enabled = data.dbs[i].enabled ? _(" yes") : _(" no"); + enabled = data.dbs[i].enabled ? yesstr : nostr; if (check_file[0] == '\0') - check_file = data.dbs[i].check_file ? _(" yes") : _(" no"); + check_file = data.dbs[i].check_file ? yesstr : nostr; if (shared[0] == '\0') - shared = data.dbs[i].shared ? _(" yes") : _(" no"); + shared = data.dbs[i].shared ? yesstr : nostr; if (persistent[0] == '\0') - persistent = data.dbs[i].persistent ? _(" yes") : _(" no"); + persistent = data.dbs[i].persistent ? yesstr : nostr; if (all == 0) /* If nothing happened so far report a 0% hit rate. */ |