Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
osd_disk_activate: fix osd umount on container stop
There's no need to have complexity to get the path of the current OSD. By the way, at the moment this complexity leads to incorrect behavior: ``` -bash-4.2# docker exec ceph-osd-2 findmnt --nofsroot --noheadings --output SOURCE --submounts --target /var/lib/ceph/osd/ /dev/mapper/atomicos-root /dev/sdb1 /dev/sda1 -bash-4.2# docker exec ceph-osd-2 df --output=target | grep '/var/lib/ceph/osd/' /var/lib/ceph/osd/ceph-0 /var/lib/ceph/osd/ceph-2 -bash-4.2# ``` In the first method used in recent branches, it means we might try to umount the root partition. In the second method used in older branches we try to umount something messed up: ``` 2021-01-14 00:17:08 /opt/ceph-container/bin/entrypoint.sh: osd_disk_activate: Unmounting /var/lib/ceph/osd/ceph-0 /var/lib/ceph/osd/ceph-2 ... umount: /var/lib/ceph/osd/ceph-0 /var/lib/ceph/osd/ceph-2: mountpoint not found ++/opt/ceph-container/bin/osd_disk_activate.sh:92: sigterm_cleanup_post(): log 'osd_disk_activate: Failed to umount /var/lib/ceph/osd/ceph-0 /var/lib/ceph/osd/ceph-2' ... ++/opt/ceph-container/bin/common_functions.sh:13: log(): echo '2021-01-14 00:17:08 /opt/ceph-container/bin/entrypoint.sh: osd_disk_activate: Failed to umount /var/lib/ceph/osd/ceph-0 /var/lib/ceph/osd/ceph-2' ``` We can easily build and predict the path to umount since we have `$CLUSTER` and `$OSD_ID` variables in the code of `osd_disk_activate.sh` Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1921750 Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com> (cherry picked from commit bd6fe34)
- Loading branch information