Commit Graph

44168 Commits

Author SHA1 Message Date
Sage Weil
94da8c1e7a debian/ceph-common.postinst: fix adduser, addgroup
Drop the extra groups thing--it's broken anyway.

Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:35:15 -04:00
Sage Weil
7c96016876 debian/ceph-common.postinst: fix /var/log/ceph permissions
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:35:15 -04:00
Sage Weil
18e0c7778a debian: rename ceph-common.postinst
There was a trailing space!

Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:35:15 -04:00
Sage Weil
7cd07490f2 PendingReleaseNotes: more notes about the 'ceph' user
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:35:15 -04:00
Sage Weil
b89d752181 global_init: ignore --set{user,group} if not root
Assume these options can only drop privileges; normal users can't setuid
root (and even if they could we wouldn't want to).

This makes ceph-disk behave when it sees the ceph user as 'root' and
invokes things with --setuser root but runs as a non-root user.

Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:35:15 -04:00
Sage Weil
aef00eb891 ceph-disk: fix get_ceph_user
getpwnam throws an exception

Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:35:14 -04:00
Sage Weil
960139edba PendingReleaseNotes: some notes about upgrade and ceph user
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:35:14 -04:00
Sage Weil
8f3185bade systemd: use --setuser and --setgroup for all daemons
Allow all daemons drop privilege themselves, instead of letting
systemd do it.

Among other things, this means that admins can conditionally not
drop prives by setting

  setuser match path = /var/lib/ceph/$type/$cluster-$id

in their ceph.conf to ease the pain of upgrade.

Signed-off-by: Sage Weil <sage@redhat.com>
Reviewed-by: Boris Ranto <branto@redhat.com>
2015-08-26 20:34:15 -04:00
Sage Weil
28fdac32e7 global: implement setuser_match_path
Allow the --setuser and --setgroup to be conditional on the
specified user/group matching the ownership of a given path.
This allows the ceph daemons to switch to user ceph for newly
deployed instances or stay as root depending on the ownership of
the data directory.

Signed-off-by: Sage Weil <sage@redhat.com>
Reviewed-by: Boris Ranto <branto@redhat.com>
2015-08-26 20:34:15 -04:00
Milan Broz
09db67fdb5 ceph-disk: set owner of created files to ceph
Signed-off-by: Milan Broz <mbroz@redhat.com>
2015-08-26 20:34:15 -04:00
Milan Broz
52e978e4b3 Set keys owner to ceph user if exists.
Also fix directory access rigths.

Signed-off-by: Milan Broz <mbroz@redhat.com>
2015-08-26 20:34:15 -04:00
Milan Broz
8bd35bd607 Set Ceph device partitions owner to ceph user in udev.
Signed-off-by: Milan Broz <mbroz@redhat.com>
2015-08-26 20:34:15 -04:00
Sage Weil
bbedc8e57e ceph-osd-prestart.sh: ensure data dir is root or ceph before start
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:34:15 -04:00
Boris Ranto
25f68aee02 init-ceph.in: Set ceph user and group when running the daemons
Signed-off-by: Boris Ranto <branto@redhat.com>
2015-08-26 20:34:15 -04:00
Boris Ranto
ceb93e8e69 ceph.spec.in: User and group must be created in ceph-common pre-install script
The package ceph-common uses ceph user and group but they are both created in
ceph package %pre phase. We need to move the script to ceph-common %pre phase.

Signed-off-by: Boris Ranto <branto@redhat.com>
2015-08-26 20:34:15 -04:00
Boris Ranto
e95904f704 ceph.spec.in: /var/lib/ceph is owned by ceph package
Signed-off-by: Boris Ranto <branto@redhat.com>
2015-08-26 20:34:15 -04:00
Boris Ranto
d9df52b49a ceph.spec.in: Fix ceph.limits.d path
Signed-off-by: Boris Ranto <branto@redhat.com>
2015-08-26 20:34:15 -04:00
Boris Ranto
2d4f3a9199 ceph.spec.in: Fixup uid/gid setting
We need to set the variables in the %pre phase, otherwise they are not properly
evaluated. Also use /sbin/nolongin instead of /bin/false and set the default
uid/gid pair for fedora and rhel (these were already allocated). We can also
use them for older fedora releases as they are guaranteed to be free.

Signed-off-by: Boris Ranto <branto@redhat.com>
2015-08-26 20:34:15 -04:00
Danny Al-Gaaf
596c9b68c8 ceph.spec.in: install ceph.limits.d
limits.d expect the file to end with *.conf. Add the
installed file to package list of the ceph package.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-08-26 20:34:15 -04:00
Danny Al-Gaaf
ed0cd42d24 ceph.spec.in: add ceph user/group
Add support of create ceph user/group.

TODO: Add correct number for SUSE.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-08-26 20:34:15 -04:00
Sage Weil
c7ee798a0f set nofile ulimit in /etc/security/limits.d/ceph only
Specify the nofile ulimit in one standard place, where everyone expects it
to be.  Drop it from the ceph-osd unit file.

Leave upstart and sysvinit untouched for the time being to avoid compat
issues.

Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:34:15 -04:00
Sage Weil
7c9fdf44f2 systemd: make ceph-osd setuid/gid to ceph:ceph
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:34:15 -04:00
Sage Weil
4dfe0a8a4b global: add --setuser and --setgroup options
These are done after reading config files/environment and before log files
are opened.  Allow a name or id to be specified.  In the case of --setuser,
also switch to that user's gid, unless --setgroup is also specified.

Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:34:15 -04:00
Sage Weil
6532e1c486 debian: fix /var/lib/ceph/* directory ownership
These dirs are owned by the package; make sure they are owend by the ceph
user.

Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:34:14 -04:00
Sage Weil
b8893f6b8a systemd: chown ceph:ceph /var/run/ceph
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:34:14 -04:00
Sage Weil
ec1ee5e901 systemd: run mon and mds as ceph:ceph
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:34:14 -04:00
Sage Weil
3c56938280 ceph.spec: chown and chmod /var/lib/ceph and /var/log/ceph
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:34:14 -04:00
Sage Weil
7522650939 debian: chown -R ceph:ceph /var/log/ceph
The number of log files is generally bounded; safe to chown these.

Allow ceph group members to write to this dir.

Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:34:14 -04:00
Sage Weil
2ba3d61d27 debian: chown ceph:ceph /var/llib/ceph
Do not do it recursively--there may already be huge amounts of data
here.

Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:34:14 -04:00
Sage Weil
71a0a029f8 debian: create ceph user and group
Use Debian base-passwd allocated UID/GID pair.

Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:34:14 -04:00
Yehuda Sadeh
97aed59fb9 rgw: delete finisher only after finalizing watches
Fixes: #12208

The watch error path might try to schedule a finisher work, delete finisher
only after watch destruction.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2015-08-26 15:08:18 -07:00
Casey Bodley
dd7fe61e61 memstore: add unit test for PageSet
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2015-08-26 17:49:46 -04:00
Casey Bodley
51d2553f58 memstore: add PageSet for MemStore object data
introduce class PageSet as an alternative to bufferlist for storing
object data

PageSet uses an avl set to manage its buffers, enabling lookups in
logarithmic time. this approach also allows for sparse objects

the main PageSet operations are get_range(), alloc_range(), and
free_pages_after(). get_range() returns a vector containing all allocated
pages that intersect the given range. alloc_range() does the same, but
allocates pages for any holes in the range. free_pages_after() is for
the truncate operation, and frees all allocated pages after the page
containing the given offset

PageSet uses a spinlock to provide mutual exclusion on the avl set
itself, but not for i/o operations on its pages; that's why the
interface returns pages in a vector, rather than as iterators into its
internal avl set. the pages themselves are reference counted to avoid
races between get/alloc_range() and free_pages_after()

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2015-08-26 17:49:46 -04:00
Casey Bodley
b0882fb682 memstore: replace apply_lock with sequencer
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2015-08-26 17:49:46 -04:00
Casey Bodley
79454822d7 memstore: move collection lock into get_object
only hold the collection lock while accessing the hash/object maps,
don't use it to serialize entire operations

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2015-08-26 17:49:46 -04:00
Casey Bodley
46f92f0d57 memstore: BufferlistObject uses spinlock for data
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2015-08-26 17:49:46 -04:00
Casey Bodley
61cd2da27e memstore: protect object xattrs with a mutex
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2015-08-26 17:49:46 -04:00
Casey Bodley
54739a59ab memstore: protect object omap with a mutex
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2015-08-26 17:49:46 -04:00
Casey Bodley
5d8307a10f memstore: add Object interface to hide bufferlist
this prepares MemStore for a new object data implementation that
replaces bufferlist

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2015-08-26 17:49:46 -04:00
Casey Bodley
26f716e949 memstore: use intrusive_ptr instead of shared_ptr
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2015-08-26 17:49:46 -04:00
Casey Bodley
01a9a792a7 osbench: add multithreaded objectstore benchmark
usage: ceph_objectstore_bench [flags]
         --size
               total size in bytes
         --block-size
               block size in bytes for each write
         --repeats
               number of times to repeat the write cycle
         --threads
               number of threads to carry out this workload
         --multi-object
               have each thread write to a separate object

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2015-08-26 17:49:46 -04:00
Yehuda Sadeh
d7bf8cb594 rgw: init some manifest fields when handling explicit objs
Fixes: #11455
When dealing with old manifest that has explicit objs, we also
need to set the head size and head object correctly so that
code that relies on this info doesn't break.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
2015-08-26 14:38:41 -07:00
Sage Weil
ef0536142d Merge pull request #5625 from liewegas/wip-memcpy
buffer: put inlined memcpy into a header; x86_64 only

Reviewed-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
Reviewed-by: Steve Capper <steve.capper@linaro.org>
Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
2015-08-26 14:11:49 -04:00
Kefu Chai
31143c7285 Merge pull request #5585 from tchaikov/wip-4941
mon,osd: use GMT time for the object name of hitsets

Reviewed-by: Sage Weil <sage@redhat.com>
2015-08-27 00:15:12 +08:00
Sage Weil
dda1016d5d Merge pull request #5671 from ceph/wip-msgr-fix-random
Messenger: Fix rand() generate the same sequence numbers

Reviewed-by: Kefu Chai <kchai@redhat.com>
2015-08-26 10:52:29 -04:00
Ken Dreyer
3c2d3c9313 Merge pull request #5675 from ceph/wip-12791
ceph.spec.in: remove obsolete SUSE-specific code
2015-08-26 08:50:56 -06:00
Nathan Cutler
b610588bf4 ceph.spec.in: remove obsolete SUSE-specific code
http://tracker.ceph.com/issues/12791 Fixes: #12791

Signed-off-by: Nathan Cutler <ncutler@suse.com>
2015-08-26 16:34:44 +02:00
John Spray
df21a6e212 osd: expose PGLSFilter in objclass interface
Signed-off-by: John Spray <john.spray@redhat.com>
2015-08-26 12:56:18 +01:00
Boris Ranto
c318129ba1 ceph.spec.in: Restart services only if they are running
Signed-off-by: Boris Ranto <branto@redhat.com>
2015-08-26 13:54:12 +02:00
Orit Wasserman
83b93eb7b9 Merge pull request #5639 from rzarzynski/wip-12750
rgw: fix removal during iteration over Swift metadata in filter_out_temp_url()
2015-08-26 10:37:33 +02:00