init: add systemd service files

This patch adds systemd service files. It is possible to start and
enable multiple instances (per monid, osdid, mds name), e.g.

 # systemctl start ceph-mon@node01
 # systemctl enable ceph-mon@node01

 # systemctl start ceph-osd@0
 # systemctl enable ceph-osd@0

The ceph cluster can be set in the system config file:

 /etc/sysconfig/ceph

adding or editing the CLUSTER environment variable.

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
OSD: introduce require_up_osd_peer() function for gating replica ops

This checks both that a Message originates from an OSD, and that the OSD
is up in the given map epoch.
We use it in handle_replica_op so that we don't inadvertently add operations
from down peers, who might or might not know it.

Signed-off-by: Greg Farnum <greg@inktank.com>
Refactor Messenger class family.

In preparation for XioMessenger and other new transports,
reorganize Messenger class family to remove SimpleMessenger
details the interface.

This change moves Connection to its own header, and moves Pipe
details to a new PipeConnection descdendant class, among other
changes.

Signed-off-by: Matt Benjamin <matt@linuxbox.com>
msgr: move PipeConnection out of Connection.h; make anon

Remove last reference to PipeConnection outside of SimpleeMessenger by
creating a create_anon_connection() method for Messenger.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: clean up ref counting for forwarded messages' sessions

Carry the refs across the duration of the session.  Explicitly pass
ownership to the MonSession.

Signed-off-by: Sage Weil <sage@inktank.com>
msg: factor policy handling out of SimpleMessenger

Signed-off-by: Sage Weil <sage@inktank.com>
msgr: add convenience Connection methods

Signed-off-by: Sage Weil <sage@inktank.com>
osd: use Connection::send_message

Signed-off-by: Sage Weil <sage@inktank.com>
mon: use Connection::send_message()

At least in the obvious places.

Signed-off-by: Sage Weil <sage@inktank.com>
client: use Connection::send_message()

Signed-off-by: Sage Weil <sage@inktank.com>
mds: use Connection::send_message()

Signed-off-by: Sage Weil <sage@inktank.com>
osdc/Objecter: use Connection::send_message()

Signed-off-by: Sage Weil <sage@inktank.com>
msgr: remove Messsenger::send_message(..., Connection*)

Instead, make the Connection method pure virtual and implement it in the
PipeConnection specialization (which is specific to SimpleMessenger).

Signed-off-by: Sage Weil <sage@inktank.com>
mon: use send_message instead of lazy_send_message

We only use this for sending things to non-mons, and all of those Policy's
are server, so we will never initiate a connection.  This duplicates the
'lazy' semantics we were after.

Signed-off-by: Sage Weil <sage@inktank.com>
client: use Connection::mark_down()

Signed-off-by: Sage Weil <sage@inktank.com>
mds: use Connection::mark_down()

Signed-off-by: Sage Weil <sage@inktank.com>
mon: use Connection::mark_down()

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonClient: use Connection::mark_down()

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonClient: use Connection::send_keepalive()

Signed-off-by: Sage Weil <sage@inktank.com>
osd: use Connection::mark_down()

Signed-off-by: Sage Weil <sage@inktank.com>