Commit Graph

6 Commits

Author SHA1 Message Date
Colin Patrick McCabe
8adaa0478a common: make command-line programs log to stderr
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>
2011-01-05 15:53:36 -08:00
Colin Patrick McCabe
aeba6bca5d logging: eliminate dbeginl
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
2010-12-07 22:52:21 -08:00
Colin Patrick McCabe
8f3672dc48 Replace sprintf with snprintf
Replace sprintf with snprintf. This is especially critical when the
format string includes "%s".

Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
2010-11-04 14:33:48 -07:00
Sage Weil
2c7cd49bd9 common: break init into set_defaults and init steps
This will let us tweak the default daemon/non-daemon settings as needed,
e.g. in the case of cfuse.
2010-07-01 09:25:43 -07:00
Sage Weil
1b5bb1fd6c auth: fix compile errors, warnings 2009-11-12 15:29:26 -08:00
Sage Weil
9c46520d8a test_trans 2009-11-10 08:23:38 -08:00