Moodle data folder keep losing permission

Moodle data folder keep losing permission

by Henrique Junger -
Number of replies: 4

Hi,

I'm having a problem which I can't figure it out how to solve it. We have a Moodle application hosted on a CentOS server, version 3.1.2. Everything works fine, but from times to times something changes the permissions on the data folder and several features of the Site Administration become unavailable with a message saying that the user doesn't have permissions. If I run the command line chmod -R 0777 moodledatafolder on the server, everything returns to normal.

On my config.php file the folder is correct and the permissions are set to $CFG->directorypermissions = 0750; Is there any configuration that I might be missing, so I don't have to keep changing the permissions manually?

Thanks for the help.

Average of ratings: -
In reply to Henrique Junger

Re: Moodle data folder keep losing permission

by Ken Task -
Picture of Particularly helpful Moodlers

Indeed strange ... but maybe it's not moodle code nor how it's configured.

Got anything running on the server related to file system that might reset permissions?

A CentOS server usually has something called selinux.    Check server for it's status with the following command: sestatus

You could also have some other addtional software that attempts to harden the server.

Are you allowing anyone access to moodledata via FTP or SCP that  could possibly be resetting permissions?

'spirit of sharing', Ken



In reply to Ken Task

Re: Moodle data folder keep losing permission

by Henrique Junger -

Hi Ken,

Thank you for your answer. Well, no one has access to FTP. I ran the sestatus and the current mode is enforcing with the targeted policy. Should I put to permissive?

Thanks for the help.

Henrique

In reply to Henrique Junger

Re: Moodle data folder keep losing permission

by Ken Task -
Picture of Particularly helpful Moodlers

Selinux is supposed to make your server very secure so if there are no selinux complaints, think I'd leave it alone.   It should not be responsible for the changing of permissions you've been experiencing.  If anything, selinux would have denied access to.   Think there is a log ... might check that log.   For that matter, there are other logs like secure and messages that you might also check for clues.

Can't really give you an answer cause I've never experienced the same issue.

There is something doing it ... but couldn't tell you what. :|  IF it happens on a regular basis wonder if it's not related to a cron job or some other automated process.

'spirit of sharing', Ken

In reply to Henrique Junger

Re: Moodle data folder keep losing permission

by Ken Task -
Picture of Particularly helpful Moodlers

Sorry bout this, but ... after re-thinking ... yes, set selinux to permissive.   That will require reboot of server.   But now you'll be able to see seLinux complain ... it should report something on changing permissions and allow.   But then you'd have a clue as to what might be responsible for this strange behavior.

'spirit of sharing', Ken