I'm on CentOS 6.6 and I'm having a strange problem with
I'm trying to mount an
smb share on
/var/www/html/mysite/docfolder, so I created a
docfolder inside the
mysite folder, ran
chmod 777 on it, then added:
/var/www/html/mysite/docfolder /etc/auto.docfolder --ghost
in /etc/auto.master . Then i created auto.docfolder under /etc and inside it:
pdf -fstype=cifs,rw,noperm,user=username,pass=password ://myshare/docs
When I run
sudo /sbin/service autofs restart
/var/log/messages I can read:
Jun 18 12:19:53 Rtmbssrv automount: do_mount_autofs_indirect: failed to mount autofs path /var/www/html/mysite/docfolder at /var/www/html/mysite/docfolder Jun 18 12:19:53 Rtmbssrv automount: handle_mounts: mount of /var/www/html/mysite/docfolder failed!
So I tried stopping the service and running it manually:
sudo automount -vdf
And the folder got mounted correctly without errors.
Changing the mount folder to:
/mnt/docfolder works correctly every time.
What's the difference of running
automount instead of launching
autofs as service?
Why is the service unable to mount that folder?
Edit: It's a SELinux related problem. I have to keep it enabled, so now the question is: how to give permission to autofs to mount file inside a apache folder, leaving it readable from the apache server?