summaryrefslogtreecommitdiff
path: root/sys-cluster/lustre/files/lnet.initd
blob: 44f6a322a4da33f75036e3d1fdfdbeaf10827d41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/sbin/openrc-run
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

description="Loads lnet module and configures network."

depend() {
        need net
        after bootmisc
}

start() {
        if [ "${RC_CMD}" = "restart" ];
        then
                einfo "Restarting..."
        fi

        ebegin "Loading LNet modules:"
        modprobe lnet
        eend $*

        ebegin "Bringing up LNet"
        lnetctl lnet configure --all
        eend $*
}

stop() {
        local LNETMODULES=( "ko2iblnd" "lnet" "libcfs" )
        ebegin "Bringing down LNet"
        lnetctl lnet unconfigure --all
        eend $*

        einfo "Unloading LNet modules:"
        for mod in ${LNETMODULES[@]}; do
                ebegin "... ${mod}"
                modprobe -r ${mod}
                eend $*
        done
}

status()
{
        einfo "LNet status:"
        lnetctl net show
}