Use a portable syntax for seq(1). GNU seq has a default INCR of 1, but
BSD seq has a default INCR of either +1 or -1, depending on the other
arguments. INCR must be explicitly specified for portability.
This bug is the reason that I was running into the segfaults whose
fix I reported as BUG #6510.
Signed-off-by: Alan Somers <asomers@gmail.com>
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Change interpreter from /bin/bash to /bin/sh. bash is not guaranteed
to be installed on all Unix systems, and it's not guaranteed to be
installed into /bin either.
There are other scripts that specify /bin/bash; they need to be
examined one by one to look for bashisms. This was the only one I had
to modify to get unit tests working.
Signed-off-by: Alan Somers <asomers@gmail.com>
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Don't use the "--ignore-environment" option to env. It is a
nonstandard GNU extension. The standard version is "-i".
Signed-off-by: Alan Somers <asomers@gmail.com>
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Uses find_library to search for librados, rather than using the soname.
For instance, on OSX librados is named librados.2.dylib.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
On a virgin centos-6.4, after yum-builddep ceph and following
http://ceph.com/docs/next/install/building-ceph/ instructions to:
cd ceph
./autogen.sh
./configure
make
it fails because make is not installed. It probably is not a problem for
most people because there are few developers who did not install make.
Signed-off-by: Loic Dachary <loic@dachary.org>
Add a chkconfig line for RHEL based distros to make chkconfig start rbdmap earlier on boot and stop later on shutdown. This will help prevent shutdown/reboot from hanging your system forever in the event that some daemon has a file held open on an rbd mounted filesystem.
Signed-off-by: Adam Twardowski <adam.twardowski@gmail.com>(cherry picked from commit 80384a1a24)
0x21 '!' is the first character that doesn't need encoding, so we can
expand the lower bound check.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Add a chkconfig line for RHEL based distros to make chkconfig start rbdmap earlier on boot and stop later on shutdown. This will help prevent shutdown/reboot from hanging your system forever in the event that some daemon has a file held open on an rbd mounted filesystem.
Signed-off-by: Adam Twardowski <adam.twardowski@gmail.com>
This fixes copy operations for objects that contain unsafe characters,
like a newline, which would return a 403 otherwise, since the GET to
the source rgw would be unable to verify the signature on a partially
valid bucket name.
Fixes: #6604
Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
This is useful outside of the s3 interface. Rename url_escape()
url_encode() for consistency with the exsting common url_decode()
function. This is in preparation for the next commit, which needs
to escape url-unsafe characters in another place.
Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Send the last marker whether the log is truncated in the same format
as data log list, so clients don't have more needless complexity
handling the difference. Keep bucket index logs the same, since they
contain the marker already, and are not used in exactly the same way
metadata and data logs are.
Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Consumers of this api need to know their position in the log. It's
readily available when fetching the log, so return it. Without the
marker in this call, a client could not easily or efficiently figure
out its position in the log, since it would require getting the global
last marker in the log, and then reading all the log entries.
This would be slow for large logs, and would be subject to races that
would cause potentially very expensive duplicate work.
Returning this atomically while fetching the log entries simplifies
all of this.
Fixes: #6615
Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
There's no reason to restrict returning the marker to the case where
less than the whole log is returned, since there's already a truncated
flag to tell the client what happened.
Giving the client the last marker makes it easy to consume when the
log entries do not contain their own marker. If the last marker is not
returned, the client cannot get the last marker without racing with
updates to the log.
Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
A system user should still be able to examine suspended buckets, and
get -ENOENT instead of -EACCESS for a deleted object.
Fixes: #6616
Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
through rgw_defer_to_bucket_acls config option. This configurable defaults
to an empty string. Option values include:
- recurse: If requesting perm PERM on a key, allow if user has
PERM on the
bucket to which the key belongs.
- full_control: If requesting perm PERM on a key, allow if user
has
FULL_CONTROL on the bucket to which the key belongs.
This allows users to give someone full bucket perms and be able to
operate on the keys in the bucket without modifying the perms of every
key in the bucket. This breaks S3 compatability, but that's why
it's a configurable!
Signed-off-by: Liam Monahan <liam@umiacs.umd.edu>
If multiple mons are specified in 'ceph-deploy new', but less than
those necessary for quorum are started with 'ceph-deploy mon create',
later steps (like 'ceph-deploy gatherkeys') will fail.
mon: MonClient: ping monitors without authenticating
* add support on the monitor to reply to MPing messages with the contents of
'mon_status' and 'health', regardless of a client having authenticated beforehand.
* add support on the MonClient to send a MPing message to a randomly picked
monitor (it was easier this way, '-m ip:port' allows for targeted ping) and block
waiting for a reply.
* add support on librados, pybind/rados.py and the 'ceph' tool to send pings to
monitors.
Resolves: #5984
Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Delegate that to the caller so that we can combine the result of
_mon_status() with the result of other functions.
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
In my case, making ceph.conf unreadable triggers an exception here:
Traceback (most recent call last):
File "./ceph", line 802, in <module>
sys.exit(main())
File "./ceph", line 575, in main
conf_defaults=conf_defaults, conffile=conffile)
File "/home/sage/src/ceph/src/pybind/rados.py", line 221, in __init__
self.conf_read_file(conffile)
File "/home/sage/src/ceph/src/pybind/rados.py", line 272, in conf_read_file
raise make_ex(ret, "error calling conf_read_file")
rados.Error: error calling conf_read_file: errno EACCES
Signed-off-by: Sage Weil <sage@inktank.com>
We might have cluster_handle defined, but not have
successfully connected. Instead, check if it's in
the connected state.
Signed-off-by: Greg Farnum <greg@inktank.com>