summaryrefslogtreecommitdiff
path: root/sys-cluster/ceph/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-08-11 02:19:03 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-08-11 02:19:03 +0100
commit995884416efaa899e9abe8d5c6899570e518b84b (patch)
treeb80d7fe7cc1e5e48e899d459fa62594665af4eb5 /sys-cluster/ceph/files
parentf1cd8f3514f8b9fbc1cc9cfe0dd08a8cb258e87a (diff)
gentoo auto-resync : 11:08:2022 - 02:19:03
Diffstat (limited to 'sys-cluster/ceph/files')
-rw-r--r--sys-cluster/ceph/files/ceph.logrotate18
-rw-r--r--sys-cluster/ceph/files/rbdmap.initd122
2 files changed, 0 insertions, 140 deletions
diff --git a/sys-cluster/ceph/files/ceph.logrotate b/sys-cluster/ceph/files/ceph.logrotate
deleted file mode 100644
index df03f5e69a4b..000000000000
--- a/sys-cluster/ceph/files/ceph.logrotate
+++ /dev/null
@@ -1,18 +0,0 @@
-/var/log/ceph/*.log
-{
- rotate 7
- daily
- compress
- sharedscripts
- prerotate
- for dmn in $(cd /run/ceph && ls *.asok 2>/dev/null); do
- ceph --admin-daemon /run/ceph/${dmn} log flush 2>/dev/null >/dev/null
- done
- endscript
- postrotate
- for dmn in $(cd /run/ceph && ls *.asok 2>/dev/null); do
- ceph --admin-daemon /run/ceph/${dmn} log reopen 2>/dev/null >/dev/null
- done
- endscript
- missingok
-}
diff --git a/sys-cluster/ceph/files/rbdmap.initd b/sys-cluster/ceph/files/rbdmap.initd
deleted file mode 100644
index 9313cf658863..000000000000
--- a/sys-cluster/ceph/files/rbdmap.initd
+++ /dev/null
@@ -1,122 +0,0 @@
-#!/sbin/openrc-run
-
-DESC="RBD Mapping:"
-RBDMAPFILE="/etc/ceph/rbdmap"
-
-extra_started_commands="reload"
-
-depend() {
- need localmount net
- before netmount
-}
-
-start() {
-
- if [ ! -f "${RBDMAPFILE}" ]; then
- ewarn "$DESC : No ${RBDMAPFILE} found."
- exit 0
- fi
-
- RET=0
- # Read /etc/ceph/rbdmap to create non-existant mapping
- while read DEV PARAMS; do
- case "$DEV" in
- ""|\#*)
- continue
- ;;
- */*)
- ;;
- *)
- DEV=rbd/$DEV
- ;;
- esac
- ebegin "${DESC} '${DEV}'"
- newrbd=""
- MAP_RV=""
- RET_OP=0
- OIFS=$IFS
- IFS=','
- for PARAM in ${PARAMS[@]}; do
- CMDPARAMS="${CMDPARAMS} --$(echo ${PARAM} | tr '=' ' ')"
- done
- IFS=$OIFS
- if [ ! -b /dev/rbd/${DEV} ]; then
- MAP_RV=$(rbd map ${DEV} ${CMDPARAMS} 2>&1)
- if [ $? -eq 0 ]; then
- newrbd="yes"
- else
- RET=$((${RET}+$?))
- RET_OP=1
- fi
- fi
- eend ${RET_OP} "${MAP_RV}"
-
- if [ "$newrbd" ]; then
- ## Mount new rbd
- MNT_RV=""
- mount --fake /dev/rbd/${DEV} >>/dev/null 2>&1 \
- && MNT_RV=$(mount -vn /dev/rbd/${DEV} 2>&1)
- [ -n "${MNT_RV}" ] && einfo "mount: ${MNT_RV}"
-
- ## post-mapping
- if [ -x "/etc/ceph/rbd.d/${DEV}" ]; then
- einfo "RBD Running post-map hook '/etc/ceph/rbd.d/${DEV}'"
- /etc/ceph/rbd.d/${DEV} map "/dev/rbd/${DEV}"
- fi
- fi
- done < ${RBDMAPFILE}
- eend ${RET}
-}
-
-stop() {
-
- RET=0
- ## Unmount and unmap all rbd devices
- if ls /dev/rbd[0-9]* >/dev/null 2>&1; then
- for DEV in /dev/rbd[0-9]*; do
- ## pre-unmapping
- for L in $(find /dev/rbd -type l); do
- LL="${L##/dev/rbd/}"
- if [ "$(readlink -f $L)" = "${DEV}" ] \
- && [ -x "/etc/ceph/rbd.d/${LL}" ]; then
- einfo "RBD pre-unmap: '${DEV}' hook '/etc/ceph/rbd.d/${LL}'"
- /etc/ceph/rbd.d/${LL} unmap "$L"
- break
- fi
- done
-
- ebegin "Unmapping RBD device: '${DEV}'"
- UMNT_RV=""
- UMAP_RV=""
- RET_OP=0
- MNT=$(findmnt --mtab --source ${DEV} --noheadings | awk '{print $1'})
- if [ -n "${MNT}" ]; then
- einfo "un-mounting '${MNT}'"
- UMNT_RV=$(umount "${MNT}" 2>&1)
- fi
- if mountpoint -q "${MNT}"; then
- ## Un-mounting failed.
- RET_OP=1
- RET=$((${RET}+1))
- else
- ## Un-mapping.
- UMAP_RV=$(rbd unmap $DEV 2>&1)
- if [ $? -ne 0 ]; then
- RET=$((${RET}+$?))
- RET_OP=1
- fi
- fi
- eend ${RET_OP} "${UMAP_RV}"
- [ -n "${UMNT_RV}" ] && einfo "${UMNT_RV}"
- done
- fi
- eend ${RET}
-}
-
-reload() {
- start
-}
-
-status() {
- rbd showmapped
-}