• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Logrotate stopped (don't work)

BlueOpenLand

New Pleskian
Hello,

On May 19th and for no apparent reason, I stopped working the server logrotate, may have to do with some update plesk?

Everything worked properly, but now nothing.

If you manually pass these processes, for example for apache logs, you do it correctly, but it has to be done manually.

/usr/local/psa/admin/sbin/statistics --calculate-one --domain-name=domain.com

/usr/local/psa/logrotate/sbin/logrotate -v -f /usr/local/psa/etc/logrotate.d/domain.com

In the /usr/local/psa/var/logrotate.status file I see no errors-

I also see that there are correctly the tasks in etc / cron.daily and rest, but nothing is executed, does there have to be any tasks in the root cron?

Can somebody help me? I have watched threads in the forum, but I see no concrete solution.

Has something like this happened to anyone?

Thank you.

Greetings.
 
Hi BlueOpenLand,

may have to do with some update plesk?
I doubt that guessing, because if this would be the case, MORE users would report such a bug. ;)


If you desire help from the Plesk Community, pls. start each thread at least with the output of the command:
Code:
plesk version
... because Plesk versions differ and Plesk can be installed on different operating systems!


Did you as well consider to restart the cron daemon?
Code:
service cron restart
or
Code:
service crond restart


Or/And did you consider to reboot the whole server, because of possible kernel updates/upgrades?​
 
First of all, I want to thank you for your response and your time.

My version of plesk is:

Product version: 12.5.30 Update # 66
Update date: 2017/05/17 03:43
Build date: 2016/06/08 10:00 AM
OS version: CentOS 6.7
Revision: 344620
Architecture: 64-bit
Wrapper version: 1.2

--

I have done an example of running logrotate in debug mode for fail2ban logs:

/usr/sbin/logrotate -d /etc/logrotate.d/fail2ban

reading config file /etc/logrotate.d/fail2ban
reading config info for /var/log/fail2ban.log

Handling 1 logs

rotating pattern: /var/log/fail2ban.log 1048576 bytes (7 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/fail2ban.log
log needs rotating
rotating log /var/log/fail2ban.log, log->rotateCount is 7
dateext suffix '-20170606'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /var/log/fail2ban.log.7.gz to /var/log/fail2ban.log.8.gz (rotatecount 7, logstart 1, i 7),
renaming /var/log/fail2ban.log.6.gz to /var/log/fail2ban.log.7.gz (rotatecount 7, logstart 1, i 6),
renaming /var/log/fail2ban.log.5.gz to /var/log/fail2ban.log.6.gz (rotatecount 7, logstart 1, i 5),
renaming /var/log/fail2ban.log.4.gz to /var/log/fail2ban.log.5.gz (rotatecount 7, logstart 1, i 4),
renaming /var/log/fail2ban.log.3.gz to /var/log/fail2ban.log.4.gz (rotatecount 7, logstart 1, i 3),
renaming /var/log/fail2ban.log.2.gz to /var/log/fail2ban.log.3.gz (rotatecount 7, logstart 1, i 2),
renaming /var/log/fail2ban.log.1.gz to /var/log/fail2ban.log.2.gz (rotatecount 7, logstart 1, i 1),
renaming /var/log/fail2ban.log.0.gz to /var/log/fail2ban.log.1.gz (rotatecount 7, logstart 1, i 0),
renaming /var/log/fail2ban.log to /var/log/fail2ban.log.1
running postrotate script
running script with arg /var/log/fail2ban.log: "
/usr/bin/fail2ban-client flushlogs 1>/dev/null || true
"
compressing log with: /bin/gzip
removing old log /var/log/fail2ban.log.8.gz
error: error opening /var/log/fail2ban.log.8.gz: No existe el fichero o el directorio

Apparently everything is correct, less an error, which I think is because a rotation file is missing.

--

In the /var/log directory I have seen that there is a file called cron-20170602 with a cron job log, I noticed the following lines of error:

May 20 09:01:01 olandvh03 anacron [5640]: Job `cron.daily 'locked by another anacron - skipping

These appear from the day 19 of May, that began the problem.

--

I have seen this thread: https://talk.plesk.com/threads/plesk-11s-scheduled-maintenance-tasks-not-being-run.320299/

in which you recommend to eliminate the tasks of the anacron process. If I put: ps -aux | Grep anacron I get this:

Root 1873 0.0 0.0 19052 620? Ss May19 0:00 / usr / sbin / anacron -s
Root 18086 0.0 0.0 103328 916 pts / 0 S + 10:06 0:00 grep anacron

I delete it without more, this is the cause of the problem, why reason happens this block?

Removing the anacron process can give problems to my system?

--

Do you still recommend restarting crond or the server?

Thanks again.

Greetings.
 
Hi BlueOpenLand,

I delete it without more, this is the cause of the problem, why reason happens this block?

Removing the anacron process can give problems to my system?
In some ( rare ) cases, a process couldn't finish it's job and it gets orphaned, while the PID exists untill you manually kill it. It could then block further processes on your system and can result in issues/errors/problems as described by you in your initial post of this thread.

Let's check back tomorrow, if all daily and hourly crons run as expected, while a restart of your crond service doesn't harm your system in any way.

A reboot might not be necessary, but could still be recommended in case of kernel updates/upgrades in the past, which could be as well the reason, why the anacron process couldn't be finished as expected on the 19th of may. ;)
 
Hello again,

I checked the processes again and nothing, tonight was not executed either :(

I kill the anacron process and restart crond. But again there is an anachronistic process on the list.

The / var / log / cron file tells me the following:

Jun 6 02:01:02 olandvh03 anacron[780]: Job `cron.daily' locked by another anacron - skipping
Jun 6 02:01:02 olandvh03 anacron[780]: Normal exit (0 jobs run)

This task is the general maintenance, this does not involve the rotation of logs, for example those of apache domains?

Jun 6 02:05:01 olandvh03 CROND[1711]: (root) CMD (/usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/task-script.php StoreOutgoingMessagesStatistics >/dev/null 2>&1)

In the root file of cron, I only see you are two tasks, is this normal?

0,10,20,30,40,50 * * * * /usr/local/psa/admin/bin/php -dauto_prepend_file=sdk.php '/usr/local/psa/admin/plib/modules/plesk-mobile/scripts/push_worker.php'
0 0 * * * /usr/local/psa/admin/bin/php -dauto_prepend_file=sdk.php '/usr/local/psa/admin/plib/modules/letsencrypt/scripts/renew.php'

One more fact, the server is a virtual machine, not dedicated.

The reboot, would only be worth if there are kernel updates, right?

I understand that Plesk updates are only from your system, never from the kernel, right?

Thanks again.

Greetings.
 
Hi BlueOpenLand,

I'm sorry that I can't suggest any further resolutions and I have to admit that further / deeper investigations have to be done, if you desire to get to your root cause.
Pls. consider to open a support ticket at the official Plesk support: => Contact Support - Plesk
 
Back
Top