Error during restart in Plesk 12 Watchdog modules

Created:

2016-11-16 12:43:49 UTC

Modified:

2017-04-24 11:17:02 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Error during restart in Plesk 12 Watchdog modules

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Linux

Symptoms

After restart of the server the logs ( /var/log/messages/ or /var/log/boot.log ) contain the errors:

Aug 14 15:44:25 vm24-plesk12 wdcollect[773]: Database server connection has been established.
Aug 14 15:44:25 vm24-plesk12 wdcollect[773]: Error occurred while recording statistics. The measurement is not saved in database.

or

boot.log:Bringing up loopback interface:  wdcollect[773]: Language en-US is used for sending e-mail messages.
boot.log:wdcollect[773]: Failed to connect to database server during the startup. New attempts will be made if needed.
boot.log:wdcollect[773]: Server started.

Cause

Watchdog ( wdcollect and monit services) starts by upstart job therefore it gets up before init scripts. MySQL is being started by init, so Watchdog fails to connect to database during reboot.

Resolution

The case was confirmed as internal issue #PPPM-1898 . The fix will be available with one of the future micro update. As workaround use following configuration changes:

  1. Add the following pre-start script to the upstart job (to the /usr/local/psa/libexec/modules/watchdog/init/mysql_check ):

    #!/bin/bash
    loop_count=0;
    until [ $loop_count == 10 ];do
    if [ -S /var/lib/mysql/mysql.sock ]; then
    exit 0;
    else sleep 10;
    loop_count=`expr $loop_count + 1`;
    fi
    done
    if [ $loop_count == 10 ];then
    exit 1;
    fi
  2. Modify the upstart scripts as follows (First starts 'mysql', then 'monit', and finally 'wdcollect'. Wdcollect module uses monit, so it should start the last):

First , the /etc/init/psa-monit.conf

    # psa-monit
description "Plesk Watchdog Monitor service"
author "Parallels <info@parallels.com>"

pre-start script
/usr/local/psa/libexec/modules/watchdog/init/mysql_check
end script

start on (started rc and runlevel [2345])

stop on shutdown

exec /usr/local/psa/libexec/modules/watchdog/init/monit /usr/local/psa/etc/modules/watchdog/monitrc
respawn

Second , the /etc/init/psa-wdcollect.conf

    # psa-wdcollect
description "Plesk Watchdog Collector service"
author "Parallels <info@parallels.com>"

start on (started rc and started psa-monit)

stop on shutdown

exec /usr/local/psa/libexec/modules/watchdog/init/wdcollect /usr/local/psa/etc/modules/watchdog/wdcollect.inc.php
respawn
Have more questions? Submit a request
Please sign in to leave a comment.