I have a ubuntu ec2 micro instance where I have setted up LAMP environment with mysql/phpmyadmin as well. However, my application in every few days getting 'database connectivity issue' and when I reboot the instance, it gets back normal.

When I login to terminal in such situation I can see a message as below:

*** /dev/xvda1 will be checked for errors at next reboot ***

Do anyone have any idea why this is happening and what I can do to avoid such problem? Thanks.

  • 1
    Look at your logs to find out what's happening. – Michael Hampton Jun 6 '13 at 22:41

Every time somebody logs in the pam_motd module runs all the scripts in /etc/update-motd.d/. One of these scripts is 98-fsck-at-reboot which runs /usr/lib/update-notifier/update-motd-fsck-at-reboot. In essence this script, for each ext filesystem, checks the mount count against the maximal mount count and the last fsck against the check interval to determine if a filesystem needs to be fscked, and, if so, outputs text that gets added to /etc/motd

When a system boots, upstart examines /etc/init/mountall.conf and runs mountall, which runs fsck on the filesystems if the conditions stated in the previous paragraph are met.

As you can see these goings-on are not triggered by detected errors and so probably have nothing to do with your database connectivity issues.

Most likely you are exhausting a resource (I'm guessing memory) on your micro instance and a reboot causes resource consumption to be reset. If you don't wish to troubleshoot it any further I'd upgrade to at least a small instance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.