Rcfiles: remove from runlevel 2

Merge distro patches to git.

This was rcfiles-remove-init-2.patch

Amended according to https://build.opensuse.org/request/show/244935
init-radosgw: adjust for opensuse

Merge distro patches to git.

This was radosgw-init-opensuse.patch

(cherry picked from commit 5cd81b3241061be1caf9fbe0eda34f4a0d3f945a)
Fixup radosgw daemon init.

This is a fixup for 2cd29db16497917e2e5737b7f1b52dbb77b038c2
(the late radosgw-init-opensuse.patch), radosgw needs the config
section name.

(cherry picked from commit 363022a4a2bb90b8bfe640b02e7458048e2940de)
ceph_argparse_flag has no regular 3rd parameter.

With clang warning: 'va_start' has undefined behavior with reference
types, noticing copy-paste mistake on ceph_argparse_flag.

Signed-off-by: Thorsten Behrens <tbehrens@suse.com>
(cherry picked from commit 0c7c7223a2beb4ffb953d89d316f87d350677063)
Variable length array of std::strings (not legal in C++) changed to std::vector<std::string>

Signed-off-by: Daniel J. Hofmann <daniel@trvx.org>
(cherry picked from commit 08a4e8889783673436972a979c2fc780466893c8)
[warning] Fix deprecation warning from gperftools.

(cherry picked from commit f927e487d2b5053c5653c51ebcdf0ed4bb2932fb)
Hack-fix crashing tcmalloc on sle11.

This fixes bnc#882430 in a not-so-nice way. Needs configure
rework with a --tcmalloc-minimal option or somesuch.

(cherry picked from commit 0b617bf660fb0baee10bc749bc7b430a0a794ffe)
osd/OSD.cc: parse lsb release data via lsb_release

Use lsb_release tool to be portable since parsing /etc/lsb-release
is not the same between different distributions. The old code failed
e.g. for SUSE products to parse LSB information.

Fixes: #8654

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 0b3a3987d382ff33fdf892f189b30df22be80e59)
osdmaptool/test-map-pgs.t: fix escaping to fix run

Run failed always running into the '|| cat $OUT' case due
to bad escaping of '\t'. This is caused by different shells
on different distros (e.g. bash on SUSE vs dash on Ubuntu).

Use 'grep -P ' and fix the regex to make it shell independet.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit be70c1ffe36cea56e3213bd71a47c27d7fa2a068)
Convert remaining init script actions over to suse.

Fix for bnc#887880 - both restart and stop now employ
killproc instead of the debian-ish start-stop-daemon.

(cherry picked from commit 1cd68c0dccec39e5e86588bf16306df69d351e8c)
Fix bnc#890345 - wrong service name for logrotate.

We've renamed the service to ceph-radosgw, reflect that in
logrotate config, too.

(cherry picked from commit 5886ee9142d3c115188b92868ce31ae2ca47075a)
Fix "disk zap" sgdisk invocation

If the metadata on the disk is truly invalid, sgdisk would fail to zero
it in one go, because --mbrtogpt apparently tried to operate on the
metadata it read before executing --zap-all.

Splitting this up into two separate invocations to first zap everything
and then clear it properly fixes this issue.

Based on patch by Lars Marowsky-Bree <lmb@suse.com> in ceph-deploy.
Created by Vincent Untz <vuntz@suse.com>

(cherry picked from commit 97747491ba64ffe1df344c3c15068afe73e951bb)
Switch off systemd detection

Currently systemd on ceph breaks shutting down ceph.

(cherry picked from commit 0e8635704a62d53d4876f5f461e16ba84557f4f6)
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>

Rebase of c26477448e957faf0d4f51b588b20609c4bc9791

Signed-off-by: Owen Synge <osynge@suse.com>
(cherry picked from commit a5d9ee110a132d80043cc2369ee50e7ed4743ecf)
Added a systemd target for ceph

ceph now has a target structure for systemd
set boot up sequence after network-online.target local-fs.target for mon osd and mds
Thanks to tserong@suse.com for correcting the target behaviour.

Signed of by Owen Synge - osynge@suse.com

(cherry picked from commit 7479f030dd97c94b3db6fb74f3c3f0344dc9e615)
rcceph: wrapper for ceph systemd

systemd is easy to use if you have a wrapper.
message showing available paramters to rcceph.
Also check for directories contianing mon/osd deamon settings.
Added suport for chkconfig using LSB Header

Signed off by osynge@suse.com

(cherry picked from commit b552baad2413ed01115fa408099604fc62610f52)
systemd support in ceph-disk activate

previous code just fails for systemd with an error

(cherry picked from commit 6a6de1135aa0d0e0bb3951ab9e63ad1aa0c6b5d3)
udev rules now explicitly specify init system

ceph-disk detects OS and Version and from this decides
to use sysV systemd or upstart. This code needs a bigger
rewrite so for now just explicitly tell ceph-disk the
init system.

(cherry picked from commit 0c0a0fe58266cdf54658b77d72eb97b99013b96b)