2012-12-12 16:01:49 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Helper to mount ceph-fuse from /etc/fstab. To use, add an entry
|
|
|
|
# like:
|
|
|
|
#
|
|
|
|
# # DEVICE PATH TYPE OPTIONS
|
|
|
|
# id=admin /mnt/ceph fuse.ceph defaults 0 0
|
|
|
|
# id=myuser,conf=/etc/ceph/foo.conf /mnt/ceph2 fuse.ceph defaults 0 0
|
|
|
|
#
|
|
|
|
# where the device field is a comma-separated list of options to pass on
|
|
|
|
# the command line. The examples above, for example, specify that
|
|
|
|
# ceph-fuse will authenticated as client.admin and client.myuser
|
|
|
|
# (respectively), and the second example also sets the 'conf' option to
|
|
|
|
# '/etc/ceph/foo.conf' via the ceph-fuse command line. Any valid
|
|
|
|
# ceph-fuse can be passed in this way.
|
|
|
|
|
|
|
|
set -e
|
2012-12-13 05:14:13 +00:00
|
|
|
|
|
|
|
# convert device string to options
|
|
|
|
cephargs='--'`echo $1 | sed 's/,/ --/g'`
|
|
|
|
|
2016-02-11 13:51:49 +00:00
|
|
|
# get mount point
|
|
|
|
mountpoint=$2
|
|
|
|
|
|
|
|
shift 2
|
|
|
|
|
|
|
|
while [ "$1" != "-o" ]
|
|
|
|
do
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
opts=$2
|
|
|
|
|
2012-12-13 05:14:13 +00:00
|
|
|
# strip out 'noauto' option; libfuse doesn't like it
|
2016-02-11 13:51:49 +00:00
|
|
|
opts=`echo $opts | sed 's/,noauto//' | sed 's/noauto,//'`
|
2012-12-13 05:14:13 +00:00
|
|
|
|
2014-04-25 07:20:02 +00:00
|
|
|
# strip out '_netdev' option; libfuse doesn't like it
|
|
|
|
opts=`echo $opts | sed 's/,_netdev//' | sed 's/_netdev,//'`
|
|
|
|
|
2012-12-13 05:14:13 +00:00
|
|
|
# go
|
2016-02-11 13:51:49 +00:00
|
|
|
exec ceph-fuse $cephargs $mountpoint -o $opts
|