[Ocfs2-tools-devel] [PATCH 4/6] o2cb: mount debugfs when load config

Junxiao Bi junxiao.bi at oracle.com
Mon Jun 29 01:29:29 PDT 2015


o2hbmonitor depends on debugfs to work, mount it when
load the config.

Signed-off-by: Cathy A Avery <cathy.avery at oracle.com>
Signed-off-by: Adnan G Misherfi <adnan.misherfi at oracle.com>
Signed-off-by: Junxiao Bi <junxiao.bi at oracle.com>
---
 vendor/common/o2cb.init.sh |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/vendor/common/o2cb.init.sh b/vendor/common/o2cb.init.sh
index e2f80f7..dedb408 100755
--- a/vendor/common/o2cb.init.sh
+++ b/vendor/common/o2cb.init.sh
@@ -1315,10 +1315,25 @@ check_load_module()
     return 2
 }
 
+check_debugfs_mount()
+{
+    echo "checking debugfs..."
+
+    mount | grep debugfs | grep /sys/kernel/debug > /dev/null
+    if [ "$?" -eq "1" ]
+    then
+        mount -t debugfs nodev /sys/kernel/debug
+    fi
+}
+
+
+
 load()
 {
     PLUGIN="$(select_stack_plugin)"
 
+    check_debugfs_mount
+
     touch_lockfile
 
     # XXX: SPECIAL CASE!  We must load configfs for configfs_path() to work
@@ -1820,6 +1835,16 @@ online_status()
     online_status_$PLUGIN "$CLUSTER"
 }
 
+debugfs_mount_status()
+{
+    if mount | grep debugfs | grep /sys/kernel/debug > /dev/null
+    then
+        echo "Debug file system at /sys/kernel/debug: mounted"
+    else
+        echo "Debug file system at /sys/kernel/debug: not mounted"
+    fi
+}
+
 status()
 {
     load_status
@@ -1833,6 +1858,8 @@ status()
     online_status "$CLUSTER"
 
     userdlm_status
+
+    debugfs_mount_status
 }
 
 #
-- 
1.7.9.5




More information about the Ocfs2-tools-devel mailing list