Commit Graph

492 Commits

Author SHA1 Message Date
Sage Weil
b224eb455a Merge pull request #4456 from ceph/wip-user
run ceph daemons as user and group ceph
2015-08-26 20:41:05 -04:00
Sage Weil
c825fd7604 Merge pull request #5674 from ceph/wip-selinux-post-script
ceph.spec.in: Restart services only if they are running

Reviewed-by: Milan Broz <mbroz@redhat.com>
2015-08-26 20:38:53 -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
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
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
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
Sage Weil
f889151e46 Merge pull request #5650 from liewegas/wip-12736
uuid: use boost::random:random_device

Reviewed-by: Kefu Chai <kchai@redhat.com>
2015-08-25 21:46:11 -04:00
Nathan Cutler
d0386d2347 ceph.spec.in: drop sysvinit-specific macros that run only on openSUSE/SLE
All sysvinit-based versions of openSUSE/SLE are EOL as far as upstream Ceph is
concerned.

Signed-off-by: Nathan Cutler <ncutler@suse.com>
2015-08-25 13:49:47 +02:00
Sage Weil
dbcaa54485 uuid: use boost::random:random_device
The boost mt code uses uninitialized memory for extra randomness,
which is a bad idea in general but more importantly makes valgrind
unhappy.  Use /dev/urandom instead.

Unfortunately this introduces a link time dependency.. meh!

Fixes: #12736
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-24 14:51:47 -04:00
Rohan Mars
62bfc7a1ab moved to use boost uuid implementation, based on commit 4fe89a7b14
Signed-off-by: Rohan Mars <code@rohanmars.com>
Reviewed-by: Casey Bodley <cbodley@redhat.com>
2015-08-19 06:46:17 -04:00
Boris Ranto
e4cff034e3 ceph.spec.in: Require awk for selinux post script
Signed-off-by: Boris Ranto <branto@redhat.com>
2015-08-19 11:26:06 +02:00
Boris Ranto
9038488bc2 selinux: Relabel files if and only if the policy version changed
Currently, the ceph files are being relabelled every time the package is
rebuilt. Fix this by checking the policy versions and relabel the files
only if the policy actually changed (different policy version was
detected).

Signed-off-by: Boris Ranto <branto@redhat.com>
2015-08-19 11:17:13 +02:00
Milan Broz
28d3c4c92b Do not use hardcoded paths in spec post section for selinux commands.
Signed-off-by: Milan Broz <mbroz@redhat.com>
2015-08-18 14:25:20 +02:00
Milan Broz
fa2203e951 Add dependence to selinux-policy-base to fix installation in kickstart.
Signed-off-by: Milan Broz <mbroz@redhat.com>
2015-08-18 14:25:04 +02:00
Milan Broz
14da7e20d9 Update rpm spec to properly restart systemd ceph.target.
If we are using systemd, ceph target should be used.
Also fail to restart service should not stop policy to load.

Signed-off-by: Milan Broz <mbroz@redhat.com>
2015-08-18 14:25:04 +02:00
Nathan Cutler
6c803cdf42 ceph.spec.in: test %preun argument is zero for removal-only operations
The %preun section now contains logic for disabling and stopping all the
Ceph systemd units when the ceph package is removed. However, there is no
conditional around it, so the units are disabled and stopped on RPM upgrade
as well as removal.

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

Signed-off-by: Nathan Cutler <ncutler@suse.com>
Signed-off-by: Tim Serong <tserong@suse.com>
2015-08-13 15:36:02 +02:00
Boris Ranto
8c53a5824a ceph.spec.in: Make SELinux opt-out, not opt-in
We should enable SELinux support by default on rpm-based systems that
build with SELinux support to get better QE coverage in future runs.

Signed-off-by: Boris Ranto <branto@redhat.com>
2015-08-05 17:55:53 +02:00
Boris Ranto
c6d6c783f4 ceph.spec.in: stop/start service on policy upgrade/removal
Signed-off-by: Boris Ranto <branto@redhat.com>
2015-08-05 15:21:47 +02:00
Boris Ranto
c52eb995e0 Add initial SELinux support
This patch modifies the build system and spec file to provide a support
for SELinux enforcing in an opt-in matter via ceph-selinux package.

Signed-off-by: Boris Ranto <branto@redhat.com>
2015-08-05 15:21:41 +02:00
Sage Weil
8a67561220 ceph.spec: install the new systemd-based udev rules from ddiss
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-01 09:58:34 -04:00
Owen Synge
3d6100eb64 ceph.spec.in:Fixup renamed ceph-rgw.conf
This is a simple renaming bug.

Signed-off-by: Owen Synge <osynge@suse.com>
2015-08-01 09:58:34 -04:00
Owen Synge
e3e9548bba ceph.spec.in:fixup bad merge of systemd logic 2015-08-01 09:58:34 -04:00
Sage Weil
69cdfcb15f remove ceph-disk-{activate,prepare} wrappers
These ancient aliases shouldn't be used.  We should have removed them
immediately way back when, honestly.

Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-01 09:58:34 -04:00
Sage Weil
e034c2af43 ceph.spec: ship ceph-disk-* units
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-01 09:58:34 -04:00
Sage Weil
ac16d83914 ceph.spec: use sysvinit rbdmap script for now
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-01 09:58:34 -04:00
Sage Weil
d1ce1782ce ceph.spec: no rcceph[-radosgw] with systemd
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-01 09:58:33 -04:00
Sage Weil
6842a20915 systemd: add ceph-create-keys@ service
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-01 09:58:33 -04:00
Sage Weil
e283222d0a ceph.spec: include systemd units files
Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-01 09:58:33 -04:00
Owen Synge
1ba4694d7e Autotools to install systemd unit files.
To simplify the spec file we should install as much using autotools
and as little as possible in the spec file.

Signed-off-by: Owen Synge <osynge@suse.com>
2015-08-01 09:58:33 -04:00
Owen Synge
d6213b61ab Add unit files to the spec file.
%{_unitdir}/ceph-mds@.service
%{_unitdir}/ceph-mon@.service
%{_unitdir}/ceph-osd@.service
%{_unitdir}/ceph.target

Signed-off-by: Owen Synge <osynge@suse.com>
2015-08-01 09:58:33 -04:00
Owen Synge
ef961be507 ceph.spec.in: Change redhat defaults for rgw
Changes
		--with-rgw-user=$USER \
		--with-rgw-group=$GROUP \

to
    USER=root
    GROUP=root

from
    USER=apache
    GROUP=apache

Signed-off-by: Owen Synge <osynge@suse.com>
2015-08-01 09:58:33 -04:00
Owen Synge
61240190c7 Added tmpfiles.d for rgw: templated user and group.
tmpfiles.d are part of system.d and define how temporary directories are setup.
rgw needs a socket directory. To do this we template tmpfiles.d user and group
for rgw and fill in the values using autotools.

Note1: Added to spec file.
Note2: Name changed to rgw from radosgw as is preferred name by Sage.
Note3: Adds configure options
    --with-rgw-user=UserName
    --with-rgw-group=GroupName
Note4: Defaults set for debian
Note5: spec file overrides defaults for redhat and suse

Signed-off-by: Owen Synge <osynge@suse.com>
2015-08-01 09:58:33 -04:00
Owen Synge
95db160da3 ceph.spec.in:Update rpm hooks and file content
Take rpm hooks from SUSE rpm and move upstream.
These are tested on SLE12 to include the correct files.

Signed-off-by: Owen Synge <osynge@suse.com>
2015-08-01 09:58:33 -04:00
Sage Weil
bbe84578bf remove rest-bench
This is a weak tool; users should look to cosbench or others instead.

Signed-off-by: Sage Weil <sage@redhat.com>
2015-07-30 13:21:36 -04:00
Ken Dreyer
b8671fd176 Merge pull request #5261 from SUSE/wip-drop-py-requires
ceph.spec.in: drop SUSE-specific %py_requires macro

Reviewed-by: Ken Dreyer <kdreyer@redhat.com>
2015-07-23 07:48:12 -06:00
Ken Dreyer
fbbed3afaa Merge pull request #5263 from SUSE/wip-apache-not-required
ceph.spec.in: remove SUSE-specific apache2-mod_fcgid dependency

Reviewed-by: Ken Dreyer <kdreyer@redhat.com>
2015-07-23 07:46:27 -06:00
Kefu Chai
50a33dea0a package ceph-monstore-update-crush.sh
Fixes: #11815
Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-07-17 19:15:44 +08:00
Nathan Cutler
f3f8d3660d ceph.spec.in: remove SUSE-specific apache2-mod_fcgid dependency
This package is no longer required for RGW to work in SUSE.

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

Signed-off-by: Nathan Cutler <ncutler@suse.com>
2015-07-16 16:49:42 +02:00
Nathan Cutler
cbf6c7b46b ceph.spec.in: drop SUSE-specific %py_requires macro
%py_requires expands to

BuildRequires: /usr/bin/python
PreReq: python = 2.7

The BuildRequires: is already provided, and the PreReq is wrong because
e.g. SLE11-SP3 (a platform we are trying to support) has Python 2.6.

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

Signed-off-by: Nathan Cutler <ncutler@suse.com>
2015-07-16 14:18:12 +02:00
Kefu Chai
cfc9f493f6 packaging: package libcls_cephfs.so
Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-07-16 14:21:03 +08:00
Ken Dreyer
c74a2f86a1 packaging: RGW depends on /etc/mime.types
If the mimecap RPM or mime-support DEB is not installed, then the
/etc/mime.types file is not present on the system. RGW attempts to read
this file during startup, and if the file is not present, RGW logs an
error:

  ext_mime_map_init(): failed to open file=/etc/mime.types ret=-2

Make the radosgw package depend on the mailcap/mime-support packages so
that /etc/mime.types is always available on RGW systems.

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

Signed-off-by: Ken Dreyer <kdreyer@redhat.com>
2015-07-15 09:14:15 -06:00
Gregory Farnum
d2f3ca8377 Merge pull request #4939 from ceph/wip-offline-backward
cephfs-data-scan (offline backward file recovery)

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
2015-07-14 11:42:48 +01:00
Nathan Cutler
53072b9019 ceph.spec.in: do not run fdupes, even on SLE/openSUSE
In openSUSE there is a policy to use %fdupes in the spec file if RPMLINT
complains about duplicate files wasting space in the filesystem.

However, RPMLINT is not so complaining, so drop fdupes.

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

Signed-off-by: Nathan Cutler <ncutler@suse.com>
2015-07-13 18:17:22 +02:00
John Spray
cd6ead3583 packaging: add cephfs-data-scan
Signed-off-by: John Spray <john.spray@redhat.com>
2015-07-13 14:05:17 +01:00