Red Hat Bugzilla – Bug 554740
lazy /dev files creation on ecryptfs module load prevents ecryptfsd daemon to start
Last modified: 2013-04-12 16:34:44 EDT
Description of problem: It seems that on ecryptfs module load (modprobe ecryptfs) the module creates files under /dev /dev/misc for userspace communication with ecryptfsd. However if you start ecryptfsd fast enough it could not find these files (because they're not created yet). I've come to the following test case: killall ecryptfsd lsmod | grep ecryptfs && rmmod ecryptfs modprobe ecryptfs # echo 'sleep'; sleep 3 ecryptfsd killall ecryptfsd If you uncomment the 'sleep' line you will get following messages in /var/log/messages and ecryptfsd will fail to start. ecryptfsd[29732]: ecryptfs_init_miscdev: Error whilst attempting to open [/dev/ecryptfs]; errno msg = [No such file or directory] ecryptfsd[29732]: ecryptfs_init_miscdev: Error whilst attempting to open [/dev/misc/ecryptfs]; errno msg = [No such file or directory] ecryptfsd[29732]: main: Failed to initialize messaging; rc = [-5] ecryptfsd[29732]: Failed to send eCryptfs miscdev message; errno msg = [Bad file descriptor] ecryptfsd[29732]: ecryptfs_send_message: Failed to register miscdev daemon with the eCryptfs kernel module; rc = [-5] ecryptfsd[29732]: ecryptfsd_exit: Error attempting to send quit message to kernel; rc = [-5] ecryptfsd[29732]: ecryptfsd_exit: Closing eCryptfs userspace daemon I've also noticed that if you have ecryptfs module unloaded and start ecryptfsd it will leave ecryptfs loaded but itself dies because of unavailable files under /dev. If the ecryptfsd daemon tries to load the required module why it does not wait (or somehow handle) to succesfully connect to /dev? Version-Release number of selected component (if applicable): RHEL5.5-Server-20091227.0 kernel-2.6.18-183.el5 ecryptfs-utils-75-5.el5 How reproducible: 100% Steps to Reproduce: killall ecryptfsd lsmod | grep ecryptfs && rmmod ecryptfs modprobe ecryptfs # echo 'sleep'; sleep 3 ecryptfsd killall ecryptfsd Actual results: errors displayed in /var/log/messages and ecryptfsd could not start Expected results: ecryptfsd started successfuly Additional info:
(In reply to comment #0) > killall ecryptfsd > lsmod | grep ecryptfs && rmmod ecryptfs > modprobe ecryptfs > # echo 'sleep'; sleep 3 > ecryptfsd > killall ecryptfsd > > If you uncomment the 'sleep' line you will get following messages in > /var/log/messages and ecryptfsd will fail to start. That should read: "If you keep the 'sleep' line commented out you will get ..." In case you uncomment this line all is working fine. > > ecryptfsd[29732]: ecryptfs_init_miscdev: Error whilst attempting to open > [/dev/ecryptfs]; errno msg = [No such file or directory] > ecryptfsd[29732]: ecryptfs_init_miscdev: Error whilst attempting to open > [/dev/misc/ecryptfs]; errno msg = [No such file or directory] > ecryptfsd[29732]: main: Failed to initialize messaging; rc = [-5] > ecryptfsd[29732]: Failed to send eCryptfs miscdev message; errno msg = [Bad > file descriptor] > ecryptfsd[29732]: ecryptfs_send_message: Failed to register miscdev daemon with > the eCryptfs kernel module; rc = [-5] > ecryptfsd[29732]: ecryptfsd_exit: Error attempting to send quit message to > kernel; rc = [-5] > ecryptfsd[29732]: ecryptfsd_exit: Closing eCryptfs userspace daemon
Created attachment 407763 [details] patch to fix this
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2011-1503.html