cea-hpc / robinhood

Robinhood Policy Engine : a versatile tool to monitor filesystem contents and schedule actions on filesystem entries.
http://robinhood.sf.net
Other
177 stars 60 forks source link

rbh-config enable_chglogs unable to detect MDT on lustre 2.12.3 #113

Closed barthe closed 3 years ago

barthe commented 4 years ago

Hi there,

the path the script is looking for has changed on lustre 2.12.3

[root@taranisrbh0 ~]# rpm -q lustre-client 
lustre-client-2.12.3-1.el7.x86_64

I quickly fix it by replacing the possible paths by the good one for my lustre version ;-)

[root@taranisrbh0 ~]# diff -up /usr/sbin/rbh-config /tmp/rbh-config
--- /usr/sbin/rbh-config        2019-11-08 13:38:00.000000000 +0000
+++ /tmp/rbh-config     2020-09-11 15:41:11.101821608 +0000
@@ -228,7 +228,7 @@ function enable_changelogs
     if (($interactive != 0 )); then
             # check if we are on mdt
             echo -n "Checking available MDTs...    "
-           fslist=`ls -d  /proc/{fs,sys}/{lnet,lustre}/mdd/*-MDT* 2>/dev/null | sed -e "s/-MDT[0-9]*//" | awk -F '/' '{print $NF}' | uniq | xargs`
+           fslist=`ls -d  /sys/kernel/debug/lustre/mdd/*-MDT* 2>/dev/null | sed -e "s/-MDT[0-9]*//" | awk -F '/' '{print $NF}' | uniq | xargs`
             echo $fslist

             if [[ -z $fslist ]]; then
@@ -260,7 +260,7 @@ function enable_changelogs
             done
     else
         fsname=$1
-        fslist=`ls -d  /proc/{fs,sys}/{lnet,lustre}/mdd/*-MDT* 2>/dev/null | sed -e "s/-MDT[0-9]*//" | awk -F '/' '{print $NF}' | uniq | xargs`
+        fslist=`ls -d  /sys/kernel/debug/lustre/mdd/*-MDT* 2>/dev/null | sed -e "s/-MDT[0-9]*//" | awk -F '/' '{print $NF}' | uniq | xargs`
         if [[ $fslist = *$fsname* ]]; then
                 echo "file system '$fsname' exists"
         else
martinetd commented 4 years ago

Hi! Thanks for the feedback, we don't use that feature of the script much. A better fix would be to use lctl get_param and lctl set_param; that's true for the other /proc/{fs,sys} paths as well around the script.

It's not a difficult change to do but the following sed will need a small adjustment -- if you're up for it could you open a PR or send a patch to gerrithub? That could be a nice first contrib :)

tl-cea commented 4 years ago

Hello, There are already pending patches for that. In particular: https://review.gerrithub.io/c/cea-hpc/robinhood/+/499210

I suggest you get the whole stack of patches to benefit from latest ports and improvements: git fetch "https://review.gerrithub.io/cea-hpc/robinhood" refs/changes/13/499213/3 && git checkout FETCH_HEAD

Regards, Thomas

tl-cea commented 3 years ago

Fixes for this issue are included to robinhood 3.1.6.

barthe commented 3 years ago

@tl-cea good news, when do you plan to release 3.1.6 ? :)

tl-cea commented 3 years ago

It has just been released today: https://sourceforge.net/projects/robinhood/files/robinhood/3.1.6/

barthe commented 3 years ago

Excellent ! I went to sourceforge via https://github.com/cea-hpc/robinhood/wiki which is not yet updated ! I will give it a try !