Cron cannot move mslog to mslog.1: Permission denied

This is the area for a general support questions, discussions and information that you can read and share. Post your experiences, stats and tricks and tips that are not covered elsewhere. Remember, for questions please search the FAQ first, as your question may already be answered.

Moderators: wizard, magicspam

Post Reply
sfligg
Posts: 5
Joined: Mon Jul 06, 2015 9:31 am

Cron cannot move mslog to mslog.1: Permission denied

Post by sfligg » Mon Jul 06, 2015 9:46 am

I am using MagicSpam for cPanel. I am getting a message (emailed) from my systems cron daemon indicating that it can not rename the log file.

mv: cannot move `/var/log/magicspam/mslog' to `/var/log/magicspam/mslog.1': Permission denied

Please advise.

magicspam
Posts: 1563
Joined: Tue Oct 28, 2008 2:27 pm

Re: Cron cannot move mslog to mslog.1: Permission denied

Post by magicspam » Mon Jul 06, 2015 1:03 pm

Hello sfligg,

Thank you for your question! It appears as though there is a permissions issue here. All of the log files should be owned by the 'magicspam' user. You can repair this with:

Code: Select all

chown -R magicspam:magicspam /var/log/magicspam
You will also want to make sure that the 'magicspam' user has a home directory that exists. You can check this directory exists, and make sure it is owned by the MagicSpam user with the following:

Code: Select all

 ls -ld ~magicspam
If the 'magicspam' user's home directory does not exist or is not owned by the 'magicspam' user, something is very wrong and we might recommend removing the magicspam-cpanel package and reinstalling the latest package from our downloads page (http://www.magicspam.com/download/). Don't worry about reinstalling as no settings will be lost.

Thanks, and let us know what you find!
-- MagicSpam Support Team --

sfligg
Posts: 5
Joined: Mon Jul 06, 2015 9:31 am

Re: Cron cannot move mslog to mslog.1: Permission denied

Post by sfligg » Wed Jul 08, 2015 5:29 am

Thank you. I just applied the ownership change (magicspam had a home directory). I will see what happens tomorrow, but I am sure it will be okay.

sfligg
Posts: 5
Joined: Mon Jul 06, 2015 9:31 am

Re: Cron cannot move mslog to mslog.1: Permission denied

Post by sfligg » Thu Jul 09, 2015 12:27 pm

No joy, it didn't work. I am still getting an error message from the cron daemon.
I did notice the subject line of the email from the cron says
/usr/share/magicspam/bin/rotate_logs /var/log/magicspam/mslog

Should I change ownership of all files in /usr/share/magicspam/bin/ to magicspam as well?

magicspam
Posts: 1563
Joined: Tue Oct 28, 2008 2:27 pm

Re: Cron cannot move mslog to mslog.1: Permission denied

Post by magicspam » Thu Jul 09, 2015 1:40 pm

Hello sfligg,

Thank you for your response and for the information, we do feel like we're making progress though. Just so you know, it shouldn't be necessary to change the ownership of the rotate_logs utility, the error indicates that it is running.

Firstly, please check and make sure you are using the latest version of MagicSpam for cPanel WHM (1.0.8-4). If you are not, please download the latest package from our download site (http://www.magicspam.com/download/) and update.

After you have verified you are using the latest version of MagicSpam, please run an md5sum on the rotate_logs utility and report back the output to us. This will help us to make sure that the utility is not corrupted in any way:

Code: Select all

 md5sum /usr/share/magicspam/bin/rotate_logs
Another step to try would be to reset your log days setting (how many days worth of logs to keep) back to the default of 7 days. We have seen issues in the past where really large retention periods caused problems.

Finally, please run the following command and send us back the output. We want to make sure there is nothing else odd going on in your log directory:

Code: Select all

ls -latrR /var/log/magicspam/
Thank you for your patience while we work through this issue,
-- MagicSpam Support Team --

sfligg
Posts: 5
Joined: Mon Jul 06, 2015 9:31 am

Re: Cron cannot move mslog to mslog.1: Permission denied

Post by sfligg » Mon Jul 13, 2015 6:49 am

Sorry for the delay in my response.

I do have the latest version installed and still have default settings (days = 7).
Below is the output as requested:

root@XXXXXX [/usr/share/magicspam/bin]# md5sum /usr/share/magicspam/bin/rotate_logs
0d3e92bfa3eba073a005c33b141f1071 /usr/share/magicspam/bin/rotate_logs
root@XXXXXX [/usr/share/magicspam/bin]#


root@XXXXXX [/usr/share/magicspam/bin]# ls -latrR /var/log/magicspam/
/var/log/magicspam/:
total 3156
-rw-r--r-- 1 magicspam magicspam 749 Jun 30 23:46 .counter2.dat.06
drwxr-xr-x 2 magicspam magicspam 4096 Jul 1 00:04 ./
drwxr-xr-x 18 root root 4096 Jul 13 09:33 ../
-rw-rw-r-- 1 magicspam magicspam 3203202 Jul 13 09:41 mslog
-rw-r--r-- 1 magicspam magicspam 749 Jul 13 09:41 .counter2.dat.07
root@XXXXXX [/usr/share/magicspam/bin]#

magicspam
Posts: 1563
Joined: Tue Oct 28, 2008 2:27 pm

Re: Cron cannot move mslog to mslog.1: Permission denied

Post by magicspam » Mon Jul 13, 2015 12:44 pm

Hello sfligg,

Thank you for your reply and for the information. We were discussing your case and there is definitely something interesting going on here. We are curious, is SELinux enabled on your server? If it is, is it running in permissive mode or is it enforcing? This could cause a problem if it was enforcing at the moment!

Also, please try the following, in case cagefs is being used on your server:

Code: Select all

/usr/sbin/cagefsctl --disable magicspam
We look forward to your reply,
-- MagicSpam Support Team --

sfligg
Posts: 5
Joined: Mon Jul 06, 2015 9:31 am

Re: Cron cannot move mslog to mslog.1: Permission denied

Post by sfligg » Tue Jul 14, 2015 6:14 am

SELinux is not enabled and cagefs is not being used.

Thank you.

magicspam
Posts: 1563
Joined: Tue Oct 28, 2008 2:27 pm

Re: Cron cannot move mslog to mslog.1: Permission denied

Post by magicspam » Tue Jul 14, 2015 11:02 am

Hell sfligg,

Thank you for you reply and for checking that. At this stage we think that something is *very* unusual and possibly esoteric. If you could, please contact us directly via email at support@magicspam.com so that we can hopefully get this sorted out for you right away.

-- MagicSpam Support Team --

Post Reply

Return to “General Discussions and Support Questions”

Who is online

Users browsing this forum: No registered users and 5 guests