You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/sys-cluster/lustre/files/lustre-client.initd

48 lines
1.1 KiB

#!/sbin/openrc-run
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
description="Load lustre modules"
extra_commands="checkmodule"
depend() {
need lnet
before netmount
}
checkmodule() {
local LOADED="$(lctl modules | awk -F"/" /lustre/'{print $2F}')"
for mod in ${LOADED[@]}; do
ewarn "Module is still loaded: ${mod}"
eend $*
done
}
start() {
if [ "${RC_CMD}" = "restart" ];
then
einfo "Restarting Lustre..."
checkmodule
fi
ebegin "Loading Lustre modules..."
modprobe lustre
eend $*
}
stop() {
local LMODULES=( "lustre" "osc" "mgc" "lmv" "fld" "mdc" "fid" "lov" "ptlrpc" )
ebegin "Trying to unmount all Lustre fs"
umount -a -t lustre
eend $*
einfo "Unloading lustre modules:"
for mod in ${LMODULES[@]}; do
ebegin "... ${mod}"
modprobe -r ${mod}
eend $*
done
checkmodule
}