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...
Created attachment 292239 [details] Strace from /etc/init.d/ocfs2 start
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)
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
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...
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....
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.
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} }
Removed from the tree