Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 390231 - sys-fs/ocfs2-tools-1.6.4 init scripts not working on kernel 3.X
Summary: sys-fs/ocfs2-tools-1.6.4 init scripts not working on kernel 3.X
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Gentoo Cluster Team
URL:
Whiteboard: Pending removal: 2018-02-04
Keywords: PMASKED
Depends on:
Blocks: 538730
  Show dependency tree
 
Reported: 2011-11-11 23:46 UTC by Marek Królikowski
Modified: 2018-03-11 10:41 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Strace from /etc/init.d/ocfs2 start (strace.log,168.80 KB, text/plain)
2011-11-11 23:47 UTC, Marek Królikowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Królikowski 2011-11-11 23:46:18 UTC
After upgrade kernel from 2.6.32 to 3.X, sys-fs/ocfs2-tools-1.6.4 init start script stop working.


Reproducible: Always

Steps to Reproduce:
1. emerge kernel 3.X
2. emerge sys-fs/ocfs2-tools
3. POCZTA2 ocfs2-tools # /etc/init.d/ocfs2 start


Actual Results:  
 * ERROR: ocfs2 failed to start

Expected Results:  
Create Clouster OCFS2

When i start from "hand" working good:
POCZTA2 # /sbin/o2cb_ctl -H -n POCZTA -t cluster -a online=yes
Cluster POCZTA created
Node POCZTA1 added
Node POCZTA2 added
But when i start from init script - there is a problem...
Comment 1 Marek Królikowski 2011-11-11 23:47:20 UTC
Created attachment 292239 [details]
Strace from /etc/init.d/ocfs2 start
Comment 2 Alexey Shvetsov archtester gentoo-dev 2011-11-12 12:40:17 UTC
I dont see any problems here.

alexxy@c-3-7 ~ $ rc-status -a | grep ocfs2
 ocfs2                                                             [  started  ]
alexxy@c-3-7 ~ $ 
alexxy@c-3-7 ~ $ uname -a
Linux c-3-7 3.1.0-gentoo-r1 #2 SMP Wed Nov 9 19:38:47 MSK 2011 x86_64 AMD Opteron(tm) Processor 6174 AuthenticAMD GNU/Linux
alexxy@c-3-7 ~ $ mount | grep ocfs2
none on /sys/kernel/dlm type ocfs2_dlmfs (rw)
/dev/sdb on /home type ocfs2 (rw,_netdev,heartbeat=local)
Comment 3 Marek Królikowski 2011-11-12 13:19:50 UTC
That interesting how work for You...
Look this is debug mode:
POCZTA2 ~ # /etc/init.d/ocfs2 -d start
+ _conf_d=/etc/init.d/../conf.d
[CUT]
+ return 1
+ egrep -q '\s*ocfs2\s*$' /proc/filesystems
+ egrep -q '\s*ocfs2_dlmfs\s*$' /proc/filesystems
+ return 1
+ return 1
+ exit 1
 * ERROR: ocfs2 failed to start
Comment 4 Marek Królikowski 2011-11-12 14:03:03 UTC
Who ever write this init.d script do amazing bad work.
Look at this:
POCZTA2 ~ # /etc/init.d/ocfs2 -d stop
[CUT]
+ local ret
+ ebegin 'Unmounting OCFS2 filesystems'
 * Unmounting OCFS2 filesystems ...
++ umount -art ocfs2
+ '[' -z '' ']'
+ ret=0
+ eend 0 'Failed to simply unmount filesystems'    

This is AMAZING epic

i can`t STOP service because i don`t have mounted OCFS filesystem...
With full respect but why this script don`t check cat /proc/mount |grep ocfs2
If YES umount & stop service 
If NO just stop service...
Comment 5 Marek Królikowski 2011-11-12 14:09:24 UTC
sorry o don`t give everything:
So:
POCZTA2 ~ # /etc/init.d/ocfs2 stop
 * Unmounting OCFS2 filesystems [ ok ]
POCZTA2 ~ # cat /sys/kernel/config/cluster/PLK/reconnect_delay_ms
2000
POCZTA2 ~ # /etc/init.d/ocfs2 stop
 * WARNING: ocfs2 is already stopped

but ofc like You see still started - script say OK but it`s not OK because he can`t umount filesystem because i don`t mount any ocfs filesystems....
Comment 6 Charlie 2012-05-09 09:09:25 UTC
same issue with kernel 2.6.32
The failure is in the check_modules function of the /etc/init.d/ocfs2 script.
The first line of code

 check_modules_config "ocfs2_dlmfs ocfs2 ocfs2_dlm ocfs2_nodemanager" "OCFS2_FS OCFS2_FS_O2CB" && check_modules_config configfs CONFIGFS_FS && return 0

is always failing, probably because the checked modules don't always exists, i suspect ocfs2_dlm (can find in 2.6.32 with lsmod) or in ls -l /sys/module

then the grep check is sucessful, but as this is only a check to echo a "helpful" message the function fails silently and the init script breaks.

just comment out the "check_modules" call in the init script and see the script start sucessfully (supossing it would have done it manually, if something else is broken then it will not start :) )
IMHO the check_module function must be debugged and rewritten, so that it works as it should.
Comment 7 Charlie 2012-05-09 09:22:27 UTC
I just noticed, that the 1.4 init script uses "modprobe -l" to check if the module exists / is loaded, this is a working approach and does detect modules that are not detected with the current approach in check_modules_config (ls of sys/module and looking at the config.gz), the current approach doesn't work if the config.gz is not generated, or for modules that do not register in /sys/module (e.g ocfs2_dlm)

Just for the doc this is the old check code (version 1.4)

check_modules() {
        local MODULES="ocfs2_dlmfs ocfs2 ocfs2_dlm ocfs2_nodemanager configfs"
        local MODULE
        local MODPROBE="modprobe -l"
        local retval=0

        for MODULE in ${MODULES}; do
                if [ -z "`${MODPROBE} ${MODULE}`" ] ; then
                        retval=1
                fi
        done
        if [ ${retval} -eq 1 ] ; then
                ewarn "One or more required modules are not loaded."
                ewarn "Make sure you have "
                ewarn " - placed ocfs, dlmfs and configfs into /etc/modules.autoload.d/kernel-2.6"
                ewarn "For a (in)complete documentation, read /usr/share/doc/ocfs-<version>/INSTALL.GENTOO.gz"
        fi
        return ${retval}
}
Comment 8 Pacho Ramos gentoo-dev 2018-03-11 10:41:13 UTC
Removed from the tree