Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Inaccessible Greyhole Shares
If you can't access your shares when Greyhole is enabled for them, and can access them when it's not, you most probably have an issue with the Greyhole VFS module for Samba.
You can verify that this is indeed your problem by enabling the Samba logs, and looking for greyhole in them.
For example, the logs below show that the Greyhole VFS module couldn't be loaded:
[2013/10/27 07:33:33.468602, 0] smbd/vfs.c:173(vfs_init_custom) error probing vfs module 'greyhole': NT_STATUS_UNSUCCESSFUL [2013/10/27 07:33:33.468658, 0] smbd/vfs.c:315(smbd_vfs_init) smbd_vfs_init: vfs_init_custom failed for greyhole [2013/10/27 07:33:33.468680, 0] smbd/service.c:869(make_connection_snum) vfs_init failed for service shared
The Greyhole VFS module is a .so file that is found in /usr/lib/greyhole/greyhole-samba3.so**
For Samba to be able to use it, it needs a to have a symlink to the proper file in /usr/lib/samba/vfs/greyhole.so
$ ls -l /usr/lib*/samba/vfs/greyhole.so lrwxrwxrwx 1 root root 39 Sep 23 13:37 /usr/lib64/samba/vfs/greyhole.so -> /usr/lib64/greyhole/greyhole-samba36.so
Make sure this symlink exists, is not broken (pointing to a missing file), and targets the correct versions for your Samba.
$ smbd --version Version 3.6.9-151.el6_4.1
The above indicates I run Samba 3.6, so my symlink needs to point to the greyhole-samba36.so file.
Apart from a broken symlink, another possible cause for this problem is that you would have AppArmor running, and preventing Samba from correctly loading the Greyhole VFS module.
Here's how you can fix issues with AppArmor, in decreasing order of specificity:
Add something to the AppArmor profile for Samba (/etc/apparmor.d/usr.sbin.smbd) to allow access. Something like
/usr/lib*/greyhole/*.so mr,Then reload the profile with
cat /etc/apparmor.d/usr.sbin.smbd | sudo apparmor_parser -r
Add an alias to the AppArmor config to make the directories considered equivalent. These are stored in /etc/apparmor.d/tunables/alias. Add a line something like
alias /usr/lib/samba/vfs/ -> /usr/lib64/greyhole/,
Set the AppArmor profile for Samba to complain mode (instead of enforce mode):
sudo aa-complain /etc/apparmor.d/usr.sbin.smbd
Disable the profile entirely:
sudo ln -s /etc/apparmor.d/usr.sbin.smbd /etc/apparmor.d/disable/ ; sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.smbd
Disable AppArmor completely:
sudo service apparmor stop ; sudo update-rc.d -f apparmor remove
After you've done whichever of these, restart the services smbd, nmbd, and apparmor (assuming you didn't disable it), in that order.