Commit Graph

36 Commits

Author SHA1 Message Date
Colin Patrick McCabe
df8c00945f cfuse: set proper defaults
Since cfuse usually runs as a nonprivileged user, its defaults must be a
little different from those of the other daemons. Add a flag to
common_init which can be used to set unprivileged daemon defaults.

SimpleMessenger::start() now just takes a boolean telling it whether to
daemonize. It doesn't need to check global variables or other arguments;
it just daemonizes if you tell it to; otherwise not.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-03-14 15:45:05 -07:00
Colin Patrick McCabe
7fe7a8165a common_init: Split common_init into multiple parts
Split common_init into several different parts which can be called
individually from libraries. Eliminate startup_flags.

Create ceph_argparse_pull and ceph_argparse_next.

Split off keyring_init from common_init.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-03-10 05:20:16 -08:00
Colin Patrick McCabe
e11bf6fe0b Replace g_conf.name and g_conf.id with entityname
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-03-08 08:38:57 -08:00
Colin Patrick McCabe
0f90d1564e Fold common_set_defaults into common_init
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-23 10:17:30 -08:00
Colin Patrick McCabe
431a5bf7c3 Rename config.h -> common/config.h
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-23 10:17:30 -08:00
Colin Patrick McCabe
2a59b2132f common: Split argument parsing into ceph_argparse
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-02-20 10:17:11 -08:00
Colin Patrick McCabe
2315759e1e common: combine set_fg_logging into common_init
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>
2011-02-08 05:11:08 -08:00
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
Greg Farnum
d0f7412e5f config: add OPT_ADDR type, move "public_addr"/"cluster_addr" processing there
Necessary side effect: move public_addr/cluster_addr into g_conf.
2010-08-03 14:56:01 -07:00
Greg Farnum
6abf48dad3 config: rename g_my_addr to g_public_addr, add g_cluster_addr 2010-08-03 14:56:01 -07:00
Sage Weil
9052986fd3 Merge branch 'unstable' into mon-remove
Conflicts:
	src/cmon.cc
	src/include/ceph_fs.h
	src/mon/MonClient.cc
	src/mon/Monitor.cc
2010-07-29 13:24:08 -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
79991ed498 debug: revamp debug/logging
- By default, append to $type.$name.log.
- Get old $hostname.$pid + $type.$name symlink behavior only with
  g_conf.log_per_instance
- Add new g_conf.log_file option to force a particular file.
2010-07-01 08:47:35 -07:00
Sage Weil
2fa4a069e8 mon: identify monitors by name, not rank 2010-06-08 15:17:08 -07:00
Sage Weil
edc92490b5 types: standardize on uint64_t
The problem is that on some platforms __u64 == uint64_t (x86_64), and on
others it's doesn't (ppc64).  Which means we don't know whether to define
different versions of overloaded functions for both types or just one.

So, standardize on uint64_t.  This plays nicer with STL, which defines
hash<uint64_t> on 64 bit arches but not 32 bit.  Which means we can't
standarzie on __u64 or else hash<__u64> won't work.  Bah!
2010-05-07 14:50:20 -07:00
Greg Farnum
1a69560a0c msg: Change all uses of ~Message to Message->put() 2010-03-31 14:59:29 -07:00
Greg Farnum
5f54543f29 msgr: Remove erroneous rank->destroy calls I inserted in 9a96bf 2010-01-07 12:05:38 -08:00
Greg Farnum
6737529631 msgr: Make usage compatible with last commit 2010-01-06 17:18:49 -08:00
Greg Farnum
9a96bf6a85 msgr: All SimpleMessenger uses are now on the heap for appropriate destruction 2010-01-06 17:18:48 -08:00
Sage Weil
805b6cbed0 Merge branch 'unstable' into auth
Conflicts:
	src/Makefile.am
	src/ceph.cc
	src/include/ceph_fs.h
	src/kernel/super.c
	src/kernel/super.h
	src/librados.cc
	src/mon/MonClient.cc
	src/mon/MonClient.h
	src/mon/Monitor.cc
	src/mon/Monitor.h
	src/mon/mon_types.h
	src/msg/Dispatcher.h
	src/msg/Message.h
	src/msg/SimpleMessenger.cc
	src/msg/SimpleMessenger.h
	src/osd/OSD.h
2009-10-21 16:13:48 -07:00
Sage Weil
7cc97f32ab msgr: change ms_handle_[peer_]reset prototype
And some small fixups in handlers along the way
2009-10-13 11:21:31 -07:00
Sage Weil
78dcc39f41 msgr: kill unused ms_handle_failure 2009-10-13 10:27:05 -07:00
Yehuda Sadeh
0bdf90da2b auth: common_init should not always init keys 2009-09-25 16:19:38 -07:00
Sage Weil
f65d127ee3 msgr: pass Connection* to msgr error handlers
This lets the error handlers get at session state (if any).
2009-09-21 14:24:35 -07:00
Sage Weil
decde38057 msgr: change dispatcher interfaces; some monclient cleanups 2009-09-15 15:02:17 -07:00
Sage Weil
6f919f1f36 msgr: deliver resets to all dispatchers; make naming consistent 2009-08-31 14:12:58 -07:00
Sage Weil
653ec485ef monclient: refactor MonMap into MonClient 2009-06-26 15:10:27 -07:00
Sage Weil
fda9dbb26e monc: add mount/umount to mon client 2009-05-07 15:32:25 -07:00
Sage Weil
be072bef3e msgr: kill static instance 'rank' of SimpleMessenger 2009-05-01 07:12:18 -07:00
Sage Weil
41766cd0b4 config: clean up common_init a bit 2009-03-20 14:19:28 -07:00
Yehuda Sadeh
29b65edc50 conf: restructure of the conf mechanism 2009-03-11 14:41:44 -07:00
Yehuda Sadeh
c511d68dea added a common initialization function 2009-02-09 15:46:02 -08:00
Yehuda Sadeh
a5a7eea27c dispatcher: cascading dispatch infrastructure 2008-12-04 14:01:12 -08:00
Sage Weil
802d0e2691 msgr: ref count message while they are owned by the messenger
Users still assume they hold the only reference, at least until
they call send_message.

One caveat is that ms_handle_failure is passed a message with an
unknown number of refs.  The method should not try to free or
re-use the message.
2008-11-20 11:43:54 -08:00
Sage Weil
831800a52f be quiet 2008-11-13 15:22:37 -08:00
Sage Weil
223ab889b9 testmsgr: messenger tester 2008-11-13 12:45:36 -08:00