ceph-osd doesn't fix /var/lib/ceph/osd ownership in postinst

Bug #1948986 reported by Simon Déziel
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ceph (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Steps to reproduce:

1) Setup and enter a LXD VM
$ lxc launch images:ubuntu/focal foo --vm
$ lxc shell foo
2) Install ceph-base in the VM
# apt-get update -qq
# apt-get --assume-yes --option=Dpkg::Options::=--force-confold install ceph-base
3) Install ceph-osd
# apt-get --assume-yes --option=Dpkg::Options::=--force-confold install ceph-osd
4) check the ownership of /var/lib/ceph/osd
# ll /var/lib/ceph/
total 48
drwxr-x--- 12 ceph ceph 4096 Oct 27 19:20 ./
drwxr-xr-x 23 root root 4096 Oct 27 19:20 ../
drwxr-xr-x 2 ceph ceph 4096 Sep 6 08:41 bootstrap-mds/
drwxr-xr-x 2 ceph ceph 4096 Sep 6 08:41 bootstrap-mgr/
drwxr-xr-x 2 ceph ceph 4096 Sep 6 08:41 bootstrap-osd/
drwxr-xr-x 2 ceph ceph 4096 Sep 6 08:41 bootstrap-rbd/
drwxr-xr-x 2 ceph ceph 4096 Sep 6 08:41 bootstrap-rbd-mirror/
drwxr-xr-x 2 ceph ceph 4096 Sep 6 08:41 bootstrap-rgw/
drwxr-xr-x 3 ceph ceph 4096 Oct 27 19:19 crash/
drwxr-xr-x 2 ceph ceph 4096 Sep 6 08:41 mds/
drwxr-xr-x 2 root root 4096 Sep 6 08:41 osd/
drwxr-xr-x 2 ceph ceph 4096 Sep 6 08:41 tmp/

The osd/ should be owned by "ceph:ceph" like the other directories.

Revision history for this message
James Page (james-page) wrote :

Looking at the postinst scripts it looks like this is an issue if ceph-base and ceph-osd are installed in two separate steps as ceph-base takes care of permissions under /var/lib/ceph in its postinst script.

Revision history for this message
James Page (james-page) wrote :

This issue won't just impact /var/lib/ceph/osd which makes me wonder if we should just move all directory creation to ceph-base and not worry about it in ceph-{osd,mon,mds,mgr} and radosgw.

Changed in ceph (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Simon Déziel (sdeziel) wrote :

That is correct, the installation order needs to be ceph-base first then ceph-osd.

When Juju puts both a ceph-fs and a ceph-osd unit on the same machine, it sometimes bring in the ceph-base first causing problems further down the road.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ceph - 16.2.6-0ubuntu2

---------------
ceph (16.2.6-0ubuntu2) jammy; urgency=medium

  [ James Page ]
  * d/ceph-{mon,osd}.postinst: Ensure permissions on
    /var/lib/ceph/{osd,mon} are correct irrespective of package
    installation order (LP: #1948986).

  [ Chris MacNaughton ]
  * d/p/patch-spdk-no-literal.patch: Disable warning->error for specific
    function calls in spdk.

 -- Chris MacNaughton <email address hidden> Thu, 11 Nov 2021 13:52:52 +0000

Changed in ceph (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.