]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rpm, debian: move smartmontools and nvme-cli to ceph-base 44177/head
authorYaarit Hatuka <yaarit@redhat.com>
Wed, 25 Aug 2021 02:12:08 +0000 (02:12 +0000)
committerCory Snyder <csnyder@iland.com>
Thu, 2 Dec 2021 13:46:24 +0000 (08:46 -0500)
We wish to be able to scrape SMART and NVMe metrics from OSD and MON
nodes. For this we require / recommend smartmontools and nvme-cli
dependencies for both the ceph-osd and ceph-mon packages.  However, the
sudoers file (which is required for invoking `smartctl` by user 'ceph')
was installed only in the ceph-osd package.  Since different packages
cannot own the same file, and because we want to be able to scrape from
every daemon, we move the dependencies and the sudoers installation to
ceph-base. For generalization, we rename:
sudoers.d/ceph-osd-smartctl -> sudoers.d/ceph-smartctl

Fixes: https://tracker.ceph.com/issues/50657
Signed-off-by: Yaarit Hatuka <yaarit@redhat.com>
(cherry picked from commit 7ca39fa92b47427af2f1c6000c653bb4dffc47fe)

Conflicts:
ceph.spec.in
debian/rules

Cherry-pick notes:
- conflict due to octopus not having jaeger dep
- conflict due to octopus not installing rbd-nbd_quiesce on debian

ceph.spec.in
debian/ceph-base.install
debian/ceph-osd.install
debian/control
debian/rules
sudoers.d/ceph-osd-smartctl [deleted file]
sudoers.d/ceph-smartctl [new file with mode: 0644]

index 38f3029eaf79ecee6e84ea09db451d6a6c7256c1..cece4e90120b0983d60e0c16bd78d36959314213 100644 (file)
@@ -414,6 +414,12 @@ Requires:      gperftools-libs >= 2.6.1
 %endif
 %if 0%{?weak_deps}
 Recommends:    chrony
+Recommends:    nvme-cli
+%if 0%{?suse_version}
+Requires:      smartmontools
+%else
+Recommends:    smartmontools
+%endif
 %endif
 %description base
 Base is the package that includes all the files shared amongst ceph servers
@@ -479,14 +485,7 @@ Group:             System/Filesystems
 %endif
 Provides:      ceph-test:/usr/bin/ceph-monstore-tool
 Requires:      ceph-base = %{_epoch_prefix}%{version}-%{release}
-%if 0%{?weak_deps}
-Recommends:    nvme-cli
-%if 0%{?suse_version}
-Requires:       smartmontools
-%else
-Recommends:    smartmontools
-%endif
-%endif
+
 %description mon
 ceph-mon is the cluster monitor daemon for the Ceph distributed file
 system. One or more instances of ceph-mon form a Paxos part-time
@@ -767,14 +766,6 @@ Requires:  lvm2
 Requires:      sudo
 Requires:      libstoragemgmt
 Requires:      python%{python3_pkgversion}-ceph-common = %{_epoch_prefix}%{version}-%{release}
-%if 0%{?weak_deps}
-Recommends:    nvme-cli
-%if 0%{?suse_version}
-Requires:       smartmontools
-%else
-Recommends:    smartmontools
-%endif
-%endif
 %description osd
 ceph-osd is the object storage daemon for the Ceph distributed file
 system.  It is responsible for storing objects on a local file system
@@ -1325,7 +1316,7 @@ ln -sf %{_sbindir}/mount.ceph %{buildroot}/sbin/mount.ceph
 install -m 0644 -D udev/50-rbd.rules %{buildroot}%{_udevrulesdir}/50-rbd.rules
 
 # sudoers.d
-install -m 0440 -D sudoers.d/ceph-osd-smartctl %{buildroot}%{_sysconfdir}/sudoers.d/ceph-osd-smartctl
+install -m 0440 -D sudoers.d/ceph-smartctl %{buildroot}%{_sysconfdir}/sudoers.d/ceph-smartctl
 
 %if 0%{?rhel} >= 8
 pathfix.py -pni "%{__python3} %{py3_shbang_opts}" %{buildroot}%{_bindir}/*
@@ -1426,6 +1417,7 @@ rm -rf %{buildroot}
 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-mgr
 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-rbd
 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/bootstrap-rbd-mirror
+%{_sysconfdir}/sudoers.d/ceph-smartctl
 
 %post base
 /sbin/ldconfig
@@ -1974,7 +1966,6 @@ fi
 %{_unitdir}/ceph-volume@.service
 %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd
 %config(noreplace) %{_sysctldir}/90-ceph-osd.conf
-%{_sysconfdir}/sudoers.d/ceph-osd-smartctl
 
 %post osd
 %if 0%{?suse_version}
index 24731dc89db10c5537610c1992cbf26f7fa01d3b..342371b414e098c196c66bd5419af27f30799465 100644 (file)
@@ -20,3 +20,4 @@ usr/share/man/man8/crushtool.8
 usr/share/man/man8/monmaptool.8
 usr/share/man/man8/osdmaptool.8
 usr/share/man/man8/ceph-kvstore-tool.8
+etc/sudoers.d/ceph-smartctl
index 9b49ff9f9d54adfdf75d639a53aa6e47ad5a5002..6b73aaa86945439d910dd557485b7de2732969f8 100755 (executable)
@@ -22,4 +22,3 @@ usr/share/man/man8/ceph-volume-systemd.8
 usr/share/man/man8/ceph-osd.8
 usr/share/man/man8/ceph-bluestore-tool.8
 etc/sysctl.d/30-ceph-osd.conf
-etc/sudoers.d/ceph-osd-smartctl
index ee62a1a6d139b44d0221201c30cd39696b91af99..d7f3c7716bca871036617db6f38bdfca8cd91058 100644 (file)
@@ -135,6 +135,8 @@ Recommends: btrfs-tools,
             libradosstriper1 (= ${binary:Version}),
             librbd1 (= ${binary:Version}),
             ntp | time-daemon,
+            nvme-cli,
+            smartmontools,
 Replaces: ceph (<< 10),
           ceph-common (<< 0.78-500),
           ceph-test (<< 12.2.2-14),
@@ -383,8 +385,6 @@ Depends: ceph-base (= ${binary:Version}),
          ${shlibs:Depends},
 Replaces: ceph (<< 10), ceph-test (<< 12.2.2-14)
 Breaks: ceph (<< 10), ceph-test (<< 12.2.2-14)
-Recommends: nvme-cli,
-            smartmontools,
 Description: monitor server for the ceph storage system
  Ceph is a massively scalable, open-source, distributed
  storage system that runs on commodity hardware and delivers object,
@@ -418,8 +418,6 @@ Depends: ceph-base (= ${binary:Version}),
          ${shlibs:Depends},
 Replaces: ceph (<< 10), ceph-test (<< 12.2.2-14)
 Breaks: ceph (<< 10), ceph-test (<< 12.2.2-14)
-Recommends: nvme-cli,
-            smartmontools,
 Description: OSD server for the ceph storage system
  Ceph is a massively scalable, open-source, distributed
  storage system that runs on commodity hardware and delivers object,
index 3a40f99dc74169c882597ebcab40e0f498d5c9d6..4e80e7a702f404d655670d273c108ec4416fd060 100755 (executable)
@@ -61,7 +61,7 @@ override_dh_auto_install:
        install -D -m 644 udev/50-rbd.rules $(DESTDIR)/lib/udev/rules.d/50-rbd.rules
        install -D -m 644 src/etc-rbdmap $(DESTDIR)/etc/ceph/rbdmap
        install -D -m 644 etc/sysctl/90-ceph-osd.conf $(DESTDIR)/etc/sysctl.d/30-ceph-osd.conf
-       install -D -m 440 sudoers.d/ceph-osd-smartctl $(DESTDIR)/etc/sudoers.d/ceph-osd-smartctl
+       install -D -m 440 sudoers.d/ceph-smartctl $(DESTDIR)/etc/sudoers.d/ceph-smartctl
 
        install -m 755 src/cephadm/cephadm $(DESTDIR)/usr/sbin/cephadm
 
diff --git a/sudoers.d/ceph-osd-smartctl b/sudoers.d/ceph-osd-smartctl
deleted file mode 100644 (file)
index 882e8b6..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-## allow ceph-osd (which runs as user ceph) to collect device health metrics
-
-ceph ALL=NOPASSWD: /usr/sbin/smartctl -a --json=o /dev/*
-ceph ALL=NOPASSWD: /usr/sbin/nvme * smart-log-add --json /dev/*
diff --git a/sudoers.d/ceph-smartctl b/sudoers.d/ceph-smartctl
new file mode 100644 (file)
index 0000000..ff2a8c5
--- /dev/null
@@ -0,0 +1,4 @@
+## allow ceph daemons (which run as user ceph) to collect device health metrics
+
+ceph ALL=NOPASSWD: /usr/sbin/smartctl -a --json=o /dev/*
+ceph ALL=NOPASSWD: /usr/sbin/nvme * smart-log-add --json /dev/*