Log files bind mounts missing after reboot

  • Issue:
    When rebooting the i-mscp server, all the bind mounts providing log file access to the users to /var/www/virtual/<main_domain>/logs/<domain> are missing.
    That bind mounts are not added to "/etc/fstab" (in difference to the bind mounts of the CronJobs and InstantSSH Plugins), but interestingly, after a configuration change (or de-activating, then activating a domain), the mount commands will be executed... but obviously, I don't want to manually disable and enable every domain manually to get the bind mounts back!


    Expected Results:
    After a server reboot, all mounts are there again. Imho, this can be done trough:
    a) adding the mount commands to the fstab (can get huge, so probably not a really good idea)
    b) triggering the code part that executes the bind mount commands when the imscp_daemon is started


    Or do I miss something (e.g. startup script) so that doesn't happen?


    Version: 1.2.9, Build: 20150703, Codename: Andromeda


    Thank you for having a look on that...

  • @mikerhyner


    Which distro, codename?


    The logs folders are normally mounted on reboot through a @reboot cronjob.


    /etc/cron.d/imscp

    Code
    1. ...
    2. # Mount customer's httpd logs at reboot
    3. @reboot root perl /var/www/imscp/engine/tools/imscp-httpd-logs-mngr > /var/log/imscp/imscp-httpd-logs-mngr.log 2>&1
    4. ...


    Thus, there is maybe another problem.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • OK thank. But I get an error message (cannot connect to database) as the cronjob kicks in within /var/log/imscp/imscp-httpd-logs-mngr.log:


    [^[[0;31mFATAL^[[0m] iMSCP::Bootstrapper::boot: Unable to connect to the SQL server: DBI connect('database=imscp;host=localhost;port=3306','root',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /var/www/imscp/engine/tools/../PerlLib/iMSCP/Database/mysql.pm line 102



    ql.pm line 102


    Where do you catch up the password for mysql root user?


    Possibly helpful, I've installed:
    - Debian 7.8
    - MariaDB 5.5
    - i-mscp 1.2.9

  • @mikerhyner



    The panel is running well? No database access problem for him?


    The password is taken from the /etc/imscp/imscp.conf file. Don't change it there because it is encrypted.


    The problem is maybe that the cronjob is run before the Mysql is started at reboot. I need to check that. Can you run the script manually:


    Shell-Script
    1. # perl /var/www/imscp/engine/tools/imscp-httpd-logs-mngr -v


    And post the output?


    You should see something like


    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Yes, panel is running well besides that problem.


    Because if I run the cronjob script maually, the log bind mounts are done, I guess that the @reboot cronjob will be started before mysql server(mariadb on my system to be exact, but shouldn't matter) is up & running.


    For the moment as a "dirty" hack, I've added a sleep before perl, so the line within /etc/cron.d/imscp looks like this:
    @reboot root sleep 30; perl /var/www/imscp/engine/tools/imscp-httpd-logs-mngr > /var/log/imscp/imscp-httpd-logs-mngr.log 2>&1

  • @mikerhyner


    Thank for your report. I'll check and fix in next release.


    Could you open a ticket on our bugtracker?

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @rauschr



    Did you ever read the CHANGELOG?


    https://github.com/i-MSCP/imscp/blob/1.2.x/CHANGELOG#L51


    To resume, the log directories which are stored in /var/log/apache2 are now mounted in the logs directory of their respective owners (customers). This allow the customers to access their HTTP logs in real time and also to access the archived logs.



    Also this allow to save diskspace and CPU time (The logs are no longer copied and thus, a cron task to copy them is no longer needed). This change has been introduced in i-MSCP version 1.2.9. However a small bug has been found: When you reboot the server, the logs are not automatically re-mounted because at time where the cron job which is responsible to mount them is run, the storage from which data are pulled from (The MySQL server) has not been started yet. This is fixed in the 1.2.x branch.



    And please, saying The df -h output very strange." without give us further info is irrelevant...

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206