After restart of the server the logs (
/var/log/boot.log) contain the errors:
Aug 14 15:44:25 vm24-plesk12 wdcollect: Database server connection has been established. Aug 14 15:44:25 vm24-plesk12 wdcollect: Error occurred while recording statistics. The measurement is not saved in database.
boot.log:Bringing up loopback interface: wdcollect: Language en-US is used for sending e-mail messages. boot.log:wdcollect: Failed to connect to database server during the startup. New attempts will be made if needed. boot.log:wdcollect: Server started.
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.
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:
Add the following pre-start script to the upstart job (to the
#!/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
Modify the upstart scripts as follows (First starts 'mysql', then 'monit', and finally 'wdcollect'. Wdcollect module uses monit, so it should start the last):
# psa-monit description "Plesk Watchdog Monitor service" author "Parallels <email@example.com>" pre-start script /usr/local/psa/libexec/modules/watchdog/init/mysql_check end script start on (started rc and runlevel ) stop on shutdown exec /usr/local/psa/libexec/modules/watchdog/init/monit /usr/local/psa/etc/modules/watchdog/monitrc respawn
# psa-wdcollect description "Plesk Watchdog Collector service" author "Parallels <firstname.lastname@example.org>" 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