diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-12-15 18:09:03 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-12-15 18:09:03 +0000 |
commit | 7bc9c63c9da678a7e6fceb095d56c634afd22c56 (patch) | |
tree | 4a67d50a439e9af63947e5f8b6ba3719af98b6c9 /sys-cluster/lustre/files/lustre-client.initd | |
parent | b284a3168fa91a038925d2ecf5e4791011ea5e7d (diff) |
gentoo resync : 15.12.2019
Diffstat (limited to 'sys-cluster/lustre/files/lustre-client.initd')
-rw-r--r-- | sys-cluster/lustre/files/lustre-client.initd | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/sys-cluster/lustre/files/lustre-client.initd b/sys-cluster/lustre/files/lustre-client.initd new file mode 100644 index 000000000000..80341f46bbb6 --- /dev/null +++ b/sys-cluster/lustre/files/lustre-client.initd @@ -0,0 +1,47 @@ +#!/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 +} |