Combine set_fg_logging into common_init. This eliminates the problem
where we briefly try to apply the logging settings from the config file
even in a program that needs to set foreground logging.
TestTimers, TestSignalHandlers, TestDoutStreambuf: don't initialize ceph
authentication. These applications don't need it.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
This was used way back when to set a clock's relative "zero" time to
simplify stat collection when running performance benchmarks. It has no
use in a real system. If we need relative time for something, we can
subtract off the zero time in the output.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
command-line programs (as opposed to daemons) should send their logs to
stderr rather than to a log file, syslog, etc. This is especially
important because most users want to run the ceph command-line programs
as non-root, and often only root has permissions to add to the ceph
log directory.
Create a new function, set_foreground_logging, that overrides ceph.conf
settings to force all log output to stderr. For daemons, we still only
send the very highest priority messages to stderr, and only before they
daemonize().
Don't ever log to stdout because it interferes with scripts that parse
the output of stdout. Instead, log to stderr if the user gives the
--foreground or --nodaemon argument.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
We may be a server, and we may be lossy. This gives us a few policies:
!server, !lossy = lossless_peer(), for bidirectional intracluster fun.
server, !lossy = lossless_server(), e.g. mds <-> client.
server, lossy = lossy_server(), e.g. mon and osd
also, the default is
!server, !lossy = client(), but that doesn't mean much. The server
decides if the connection is lossy or not. And !server just means we can
initiate the outgoing connection.
The policy will be asymmetrical for the OSDs, so we need to
track it independently.
The various assertions aren't all worked out yet. Notably,
connection races aren't quite right. But the basic bits
are there.