Commit Graph

6 Commits

Author SHA1 Message Date
David Disseldorp
e58413abf4 rbdmap: unmap RBDMAPFILE images unless called with unmap-all
When called with a "map" parameter, the rbdmap script iterates the list
of images present in RBDMAPFILE (/etc/ceph/rbdmap), and maps each entry.
When called with "unmap", rbdmap currently iterates *all* mapped RBD
images and unmaps each one, regardless of whether it's listed in the
RBDMAPFILE or not.

This commit adds functionality such that only RBD images listed in the
configuration file are unmapped. This behaviour is the new default for
"rbdmap unmap". A new "unmap-all" parameter is added to offer the old
unmap-all-rbd-images behaviour, which is used by the systemd service.

Fixes: http://tracker.ceph.com/issues/18884

Signed-off-by: David Disseldorp <ddiss@suse.de>
2017-02-16 20:31:45 +01:00
Jason Dillaman
51237c33d1 rbdmap: specify bash shell interpreter
Fixes: http://tracker.ceph.com/issues/16608
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2016-08-15 14:07:43 -04:00
Nathan Cutler
c3adc90c62 rbdmap: drop init- prefix from logger tag
Since init-rbdmap is sysvinit-specific, tagging log lines "init-rbdmap" is
potentially misleading.

In systemd- and upstart-based systems, /usr/bin/rbdmap is run directly.

Signed-off-by: Nathan Cutler <ncutler@suse.com>
2016-03-19 06:34:45 +01:00
Nathan Cutler
27bbf3e63c rbdmap: default RBDMAPFILE to reasonable value
Signed-off-by: Nathan Cutler <ncutler@suse.com>
2016-03-19 06:34:45 +01:00
Boris Ranto
c0980af3c7 rbdmap: Move do_map and do_unmap shell functions to rbdmap script
This patch creates rbdmap shell script that is called from init-rbdmap
init script. The patch also renames src/rbdmap configuration file to
src/etc-rbdmap so that rbdmap shell script can be installed via build
system directly. Finally, the patch accomodates these changes in spec
file and build system.

Fixes: #13374
Signed-off-by: Boris Ranto <branto@redhat.com>
2015-11-05 21:04:50 +01:00
Laurent Barbe
a4ddf70486 Add rc script for rbd map/unmap
Init script for mapping/unmapping rbd device on startup and shutdown.
On start, map rbd dev according to /etc/rbdmap, and force mount -a
On stop, umount file system depending on rbd and unmap all rbd
Since some distribution use symlink for /etc/mtab, the user-space attribute _netdev is not enough to umount file system before rbd dev.
(also concern: #1790)

Signed-off-by: Laurent Barbe <laurent@ksperis.com>
2013-06-24 21:48:26 -07:00