Commit Graph

170 Commits

Author SHA1 Message Date
Kefu Chai
79584862f6 src,qa: install python bindings into lib/cython_modules/lib.3
instead of checking for the WITH_PYTHON* options, just hardwire to lib.3

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-12-19 11:52:54 +08:00
Yuval Lifshitz
b8b43fe59d allow for multiple "build" dirs to exist
Signed-off-by: Yuval Lifshitz <yuvalif@yahoo.com>
2019-09-06 09:38:32 +03:00
Kefu Chai
97d786366a init-ceph: wait longer before resending $signal
if ceph-osd takes longer than 1 seconds to unmount the objectstore, it
won't get a chance to fully persist all of its stuff to disk before
init-ceph kills it again.

in my case, `MemStore::_save()` fails to write $path/collections before
it gets killed, if it has more than 512 PGs.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-04-02 14:39:01 +08:00
Alfredo Deza
27d52c2a45 init-ceph: remove ceph-disk
Signed-off-by: Alfredo Deza <adeza@redhat.com>
2018-06-13 15:16:23 -04:00
Kefu Chai
8039c46d49 init-ceph: s/lib.2/lib.$MGR_PYTHON_VERSION_MAJOR/
we should not hardwire cython_modules's path to lib.2, it should be
cython_modules/lib.3 if ceph-mgr requires python3.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-02-11 14:12:15 +08:00
Sage Weil
60d3312dc2 init-ceph: drop crush location update
OSD.cc does this on its own; no need for this script to be involved.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-01-09 16:28:44 -06:00
Kefu Chai
dbcd0ae916 init-ceph: should have a space before "]"
otherwise we will have

./bin/init-ceph: 269: [: missing ]

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-04-26 15:12:10 +08:00
Sage Weil
cff7f931cd Merge pull request #14560 from wjwithagen/wip-wjw-freebsd-init-ceph
src/init-ceph.in:  allow one((re)?start|stop) as commands

Reviewed-by: Jos Collin <jcollin@redhat.com>
2017-04-25 12:08:36 -05:00
Mohamad Gebai
885c88e0b1 init-ceph: add ceph libraries path to environment
These libraries are set in vstart.sh, but not in init-ceph. When
init-ceph is not invoked through vstart.sh, library paths are missing.

Signed-off-by: Mohamad Gebai <mgebai@suse.com>
2017-04-20 15:52:08 -04:00
Willem Jan Withagen
a74989dd96 src/init-ceph.in: allow one((re)?start|stop) as commands
- One FreeBSD these are the service command to start a service
   even if the service is not activated in /etc/rc.conf
   Which will allow ceph-disk and ceph-deploy to start even without
   setting /etc/rc.conf

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
2017-04-18 10:32:18 +02:00
Sage Weil
56f5b065ae init-ceph: fix ceph user args
Broken by 299b7d06ac

Signed-off-by: Sage Weil <sage@redhat.com>
2017-02-16 18:22:00 -05:00
Willem Jan Withagen
299b7d06ac init-ceph.in: Make init-ceph work under FreeBSD for init-system
-  FreeBSD find does not have printf option
 -  use the packaged getopt in /usr/local
 -  Only apply user-facts when user ceph is available

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
2017-02-11 13:26:58 +01:00
Kefu Chai
68ab318944 init-ceph: print trailing n in "status" output
the version command is handled by HelpHook, which does not print newline
at the end of the returned JSON. so the output of "status" subcommand
looks like:

=== osd.1 ===
osd.1: running {"version":"Development"}=== osd.2 ===
osd.2: not running.

with this change, a newline is added to the end of version.

also use the "daemon" subcommand to talk to the asok, let the "ceph" cli
to figure out the asok path.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-02-10 17:42:55 +08:00
songbaisen
e885500756 ceph: when osd_location_hook does not exist, we should exit error.
If the user define "osd crush location hook" in ceph.conf, but the
    osd_location_hook tool does not exist,we should exit error.

Signed-off-by:song baisen <song.baisen@zte.com.cn>
2017-01-17 19:47:48 +08:00
Owen Synge
cc441cbd6e src/init-ceph.in:Remove ceph-create-keys for sysv
ceph-create-keys should not be started on boot of mons with sysv init.

Signed-off-by: Owen Synge <osynge@suse.com>
2016-11-04 23:05:52 +01:00
Vladislav Odintsov
109cfc2168 init-ceph: do not use systemd-run in sysvinit
`systemd-run` logic in initscripts was introduced because of ticket
http://tracker.ceph.com/issues/7627.

If we have systemd-based operating system, we should use systemd unit files
from systemd directory to start/stop ceph daemons.
Otherwise, `daemon()` from `/etc/init.d/functions` on systemd distro starts service
in `system.slice` and everything works well.

`systemd-run` can not be run on non-systemd distros, so it's not needed
on SysV systems.

also, ceph-disk is now able to run the "systemctl"
to enable and start the ceph-osd, and ceph-deploy is also now
playing well with systemd when it comes to ceph-mon and ceph-mds

Fixes: http://tracker.ceph.com/issues/16440

Signed-off-by: Vladislav Odintsov <odivlad@gmail.com>
2016-07-05 15:03:25 +03:00
Daniel Gryniewicz
f81c0354e6 init-ceph - use sbindir, rather than hard coding sbin
Signed-off-by: Daniel Gryniewicz <dang@redhat.com>
2016-07-01 09:07:43 -04:00
Sage Weil
c2e06d8efa init-ceph: make it behave when run from a cmake build dir
Signed-off-by: Sage Weil <sage@redhat.com>
2016-06-24 11:31:46 -04:00
Li Peng
5f6fdb7d0c init-ceph.in: remove duplicated words
Signed-off-by: Li Peng <lip@dtdream.com>
2016-05-03 14:28:47 +08:00
Alexandre Derumier
b581dd56be fix ceph init script
commit 65963739cd have introduce a bug

test variables need to be quoted, or -n always return true, even if variables don't exist
2016-04-24 09:55:35 +02:00
David Zafman
5e8e03b4d0 test: Fix ceph-objectstore-tool test to run manually from src non-cmake
Fix init-ceph to handle it when CEPH_* values set

Signed-off-by: David Zafman <dzafman@redhat.com>
2016-04-18 18:29:17 -07:00
Ali Maredia
65963739cd cmake: ceph_objectstore_tool.py test passing
Replaced relative paths in shell scripts in
test/ceph_objectstore_tool.py and init-ceph.in to
work with CEPH_FOO environment variables set in cmake.
Also added CEPH_BUILD_DIR environment variable set
to CMAKE_BINARY_DIR. It is used in init-ceph and
ceph_objectstore_tool.py.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
2016-04-14 20:48:21 -04:00
Eric Cook
cf8c30acee init-ceph.in: allow case-insensitive true in `osd crush update on start'
I noticed this when openstack/puppet-ceph sliently converted my 'true'
to 'True' in ceph.conf.

Signed-off-by: Eric Cook llua@gmx.com
2016-03-05 04:51:41 -05:00
Sage Weil
2786f0bf11 Merge remote-tracking branch 'gh/jewel' 2016-03-02 09:22:28 -05:00
Sage Weil
e67b70e7fa Merge pull request #7286 from ktdreyer/wip-10587-init-ceph-disk
init-ceph.in: skip ceph-disk if it is not present

Reviewed-by: Kefu Chai <kchai@redhat.com>
2016-02-24 10:42:37 -08:00
Nathan Cutler
69291f872e packaging: move ceph_common.sh and ceph-osd-prestart.sh to /usr/lib/ceph
First, it makes sense for both ceph_common.sh and ceph-osd-prestart.sh to
reside in the same directory: make it so.

Second, /usr/lib exists on both RHEL/Fedora and SLE/openSUSE, whereas
the later lacks /usr/libexec. To make this less painful, package
ceph_common.sh and ceph-osd-prestart.sh in /usr/lib/ceph.

Third, allow e.g. FreeBSD to do its own thing by using the $(libexecdir)
Autoconf variable (but set it to /usr/lib in the spec file).

http://tracker.ceph.com/issues/14687 Fixes: #14687

Signed-off-by: Nathan Cutler <ncutler@suse.com>
2016-02-18 12:19:14 +01:00
Sage Weil
03e01ae263 init-ceph: pass TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES through
..when set in the sysconfig/default file.

Signed-off-by: Sage Weil <sage@redhat.com>
2016-01-20 18:36:08 -05:00
Ken Dreyer
7dd9af0a21 init-ceph.in: skip ceph-disk if it is not present
With the ceph-mon vs ceph-osd split packaging, users are expected to
have the ceph-mon package installed and not ceph-osd (and vice versa).
However, the init script (/etc/init.d/ceph) has a call to `ceph-disk`,
which may not be present on the machine.

Given that our packaging is not yet split upstream, this bug does not
manifest itself currently, because both ceph-mon and ceph-disk are
currently in the same "ceph" package. Once we split the packaging,
though, this will become an issue.

http://tracker.ceph.com/issues/10587 Refs: #10587

Signed-off-by: Ken Dreyer <kdreyer@redhat.com>
2016-01-19 10:01:59 -07:00
Loic Dachary
09d7a60ca8 Merge pull request #6866 from xiaoxichen/umount_before_mount
init-ceph: do umount when the path exists.

Reviewed-by: Loic Dachary <ldachary@redhat.com>
2015-12-13 13:47:30 +01:00
Xiaoxi Chen
09e21b495b init-ceph: do umount when the path exists.
If the specified mount point is in use, umount it instead
of skipping mounting the fs.

In previous code , if we forgot that we already mount something unrelated to
*this ceph osd * to the particular mount point, we will skip the mount and
finally get an error complaining superblock not matching OSD ID.

umount & remount is better because
1. If the wrong FS not in use, we can get the right FS we want and make ceph boot smoothly.
2. If the wrong FS is in use, we will get EBUSY on umount, which seems explain the situation
more clearly than superblock mismatch.

Signed-off-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
2015-12-13 16:17:56 +08:00
Sage Weil
df56dc9e02 Merge pull request #6732 from aalba6675/patch-custom-cluster-name
sysvinit: allow custom cluster names

Reviewed-by: Sage Weil <sage@redhat.com>
2015-12-11 10:24:45 -05:00
Anthony Alba
13925c706d init-ceph.in: Allow custom cluster names during startup.
Signed-off-by: Richard Chan <richard@treeboxsolutions.com>
2015-12-02 07:48:23 +08:00
wangchaunhong
2f36909e1e init-ceph: fix systemd-run cant't start ceph daemon sometimes
Fixes: #13474
Signed-off-by: Chuanhong Wang <wang.chuanhong@zte.com.cn>
2015-12-01 10:29:09 -05:00
Nathan Cutler
a6d354c622 src/init-ceph.in: remove unused variables
Signed-off-by: Nathan Cutler <ncutler@suse.com>
2015-11-11 14:10:19 +01:00
Nathan Cutler
d4c0969714 src/init-ceph.in: improve usage message
Signed-off-by: Nathan Cutler <ncutler@suse.com>
2015-11-11 14:10:19 +01:00
Nathan Cutler
c994c0a9c4 src/init-ceph.in: process command-line options using getopt
http://tracker.ceph.com/issues/3015 Fixes: #3015

Signed-off-by: Nathan Cutler <ncutler@suse.com>
2015-11-11 14:10:14 +01:00
Sage Weil
3aa38bc07f make /var/run/ceph 770 ceph:ceph
This allows members of the ceph group to make librados clients (like the
ceph cli and qemu) create sockets in the default /var/run/ceph/* location.

Signed-off-by: Sage Weil <sage@redhat.com>
2015-09-11 11:26:59 -04:00
Yan, Zheng
bb1fa7f399 init-ceph: check if /lib/lsb/init-functions exists
On OSX/FreeBSD, /lib/lsb/init-functions does not exist

Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-08-31 16:00:24 +08:00
Yan, Zheng
4594adbc8f init-ceph: don't use procfs to check if daemon is running
use ps(1) instead, which is portable

Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-08-31 16:00:24 +08:00
Yan, Zheng
69e2060f17 init-ceph: replace 'echo -n' with printf
'echo -n' is no portable. On OSX, output of 'echo -n' can be '-n'

Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-08-31 16:00:24 +08:00
Sage Weil
743b15b412 debian: /var/run/ceph should be owned by ceph:ceph
Fix upstart and sysvinit scripts to create /var/run/ceph properly.

Chown existing dir on upgrade.

Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:35: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
John Spray
af31afa828 init-ceph.in: set executable bit
Scripts expect the generated init-ceph script
to be +x, and CMake does that if the file you
feed into it is +x.  This matches what we already
do with ceph.in.

Signed-off-by: John Spray <john.spray@redhat.com>
2015-08-10 14:05:53 +01:00
Sage Weil
e9e68655d7 init-ceph, ceph-osd-prestart: set osd weight with more precision
Our fixed point weights can go down to .0001 -- allow that.

Fixes: #11500
Signed-off-by: Sage Weil <sage@redhat.com>
2015-06-02 14:20:31 -07:00
huangjun
449ef48191 init-ceph.in: Create osd data dir before fs_type check.
One host in cluster crashed and rebuilded, but failed to start osds
  because the data dir not exist.

  Signed-off-by: huangjun <hjwsm1989@gmail.com>
2015-05-16 18:47:20 +08:00
Joao Eduardo Luis
189ef38074 init-ceph.in: add $PWD to PATH if running as ./init-ceph
ceph-mon needs crushtool in PATH and dev environments may not have
crushtool in the system's PATH.

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
2015-02-04 14:05:14 +00:00
Loic Dachary
487c22a8a4 init-ceph: stop returns before daemons are dead
The existence of the pidfile must be checked outside of the loop to send
a signal to the daemon. Otherwise the daemon will remove the pidfile and
stop can return before the process is dead because it only checks
/proc/$pid if the pidfile exists.

http://tracker.ceph.com/issues/10389 Fixes: #10389

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-01-07 10:52:20 +01:00
Dongmao Zhang
24eb564768 Remove pidfile and asok after stopping ceph
Signed-off-by: Dongmao Zhang <deanraccoon@gmail.com>
2014-11-25 18:04:37 +08:00
Boris Ranto
2a61735621 Fedora 19 uses systemd but there is no systemd-run available in the release (rhbz#1157938), this patch makes sure that the init scripts check for availability of systemd-run before they use it (otherwise, they fall back to the default method)
Signed-off-by: Boris Ranto <branto@redhat.com>
2014-11-06 15:38:51 +01:00
Dan Mick
0778a4f243 Merge pull request #2811 from ceph/wip-vstart
init-ceph: make ./init-ceph behave from src dir on systemd
2014-10-30 11:19:01 -07:00