If we are starting many daemons and hit an error, we normally note it and
move on. Do the same when doing the pre-mount step.
Fixes: #8554
Signed-off-by: Sage Weil <sage@inktank.com>
There can be only one init system starting a daemon. If there is a
host entry in ceph.conf for a daemon, sysvinit would try to start it
even if the daemon's directory did not include a sysvinit file. This
preserves backwards compatibility with older installs using sysvinit,
but if an upstart file is present in the daemon's directory, upstart
will try to start them, regardless of host entries in ceph.conf.
If there's an upstart file in a daemon's directory and a host entry
for that daemon in ceph.conf, both sysvinit and upstart would attempt
to manage it.
Fix this by only starting daemons if the marker file for the other
init system is not present. This maintains backwards compatibility
with older installs using neither sysvinit or upstart marker files,
and does not break any valid configurations. The only configuration
that would break is one with both sysvinit and upstart files present
for the same daemon.
Backport: emperor, dumpling
Reported-by: Tim Spriggs <tims@uahirise.org>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Match a symlink to a dir, not just dirs. This fixes the osd case of e.g.,
creating an osd in /data/osd$id in which ceph-disk makes a symlink from
/var/lib/ceph/osd/ceph-$id.
Fix proposed by Matt Thompson <matt.thompson@mandiant.com>; extended to
include the upstart users too.
Fixes: #5490
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
- prepend $local to the $allconf list at the top
- remove $local special case for all case
- fix the type prefix checks to explicitly check for prefixes
Fugly bash, but works!
Backport: cuttlefish, bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
When starting we often loop over many daemon instances. Currently we stop
on the first error and do not try to start other daemons.
Instead, try them all, but return a failure if anything did not start.
Fixes: #2545
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Gary Lowell <gary.lowell@inktank.com>
In get_local_daemon_list() the sed expression trimming the cluster
name from the host name was trimming too much if the host name
contained hyphens.
Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
This is a common error and there's no reason the script can't
at least tell you it's a really bad idea. One might argue it
could even successfully proactively truncate the host parameter
at the first dot, but that's a little controlling, perhaps.
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
With set -e this seems to fail (at least on some machines) if, say, there
is no MDS in the conf file. This fixes it.
Tested-by: Mark Nelson <mark.nelson@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
Search /var/lib/ceph/$type/ceph-$id and start/stop those daemons if
present and tagged with the sysvinit file.
Signed-off-by: Sage Weil <sage@inktank.com>
If there is a 'sysvinit' file in the daemon directory in the default
location (/var/lib/ceph/$type/ceph-$id), consider it sysvinit-managed.
Signed-off-by: Sage Weil <sage@inktank.com>
Given a ceph.conf that looks like
[osd.42]
host = localhost
mkcephfs used to exit with an obscure error message:
cat: /tmp/mkcephfs.MCBIHvn4Ru/key.*: No such file or directory
"localhost" was never intended to be a valid hostname to use there.
Warn if we see it, and skip the entry. You should use the proper short
hostname of the box.
As init-ceph and mkcephfs share this library, this change affects the
sysvinit scripts too. The behavior *shouldn't* change there (localhost
entries were ignored earlier, too), but you may see this extra
warning. Which is good.
Closes: #3001
Signed-off-by: Tommi Virtanen <tv@inktank.com>
This will make it easier for sysvinit and upstart to coexist.
We will break existing users who have a separate .conf for each node and
didn't add host lines. We'll need to make note of that in the release
notes.
Fixes: #2404
Signed-off-by: Sage Weil <sage@inktank.com>
Using do_root_cmd() doesn't really need to sudo to root
if you're already root.
Commit 71dc75bdaf causes a regression:
when system "foo" has a sudoers config that requires a tty,
init-ceph now fails like this:
sudo: sorry, you must have a tty to run sudo
when it is invoked by root with something like this:
ssh foo /etc/init.d/init-ceph start
Signed-off-by: Jim Schutt <jaschut@sandia.gov>
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
It used to just not sudo if $user was empty, on non-ssh do_root_cmd's.
This bug was exposed by commit 47b09e2f04.
Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
We were bailing out of mkcephfs with a config with no mds's defined
(because we set -e and grep returns an error here).
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
The goal is to support the old "ssh to everything" mode and also a
piecewise mode that lets the administrator do each step and handle
data copying and remote execution themselves.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Everyone uses get_conf to get configuration values. So the logic for
defaulting to some value if we can't find the requested key should live
there. Also fix a case in cconf where we could encounter a usage error
and keep on going.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>