Apache logs and immutable flag

  • Hi there,


    on my server I have some troubles regarding the log mounts. So I decided to turn them off because I am the only one using it and I can take a look into /var/log/apache2/ whenever I need.


    But there is one strange thing which maybe need to be checked:
    After editing the /etc/imscp/apache/apache.data and switching MOUNT_CUSTOMER_LOGS to no I was unable to reconfigure. The reason was, that the reconfigure script is unable to remove the /var/www/virtual/domain.tld/logs folder. As I checked it it was still flagged with the immutable flag to prevent its deletion. For me the only solution was to switch it on again, reconfigure, removing web protection using imscp panel and to do it again. Then it worked without any troubles.



    So maybe the reconfigure is not checking for immutable flag if it is removing the mounted log folders?!?



    Please keep in mind that there could be a problem on my server - maybe:


    https://i-mscp.net/index.php/T…-protection/?postID=58190

  • @UncleSam


    Your i-MSCP version is 1.5.1?
    Your i-MSCP httpd server implementation is? (ITK, FPM, FCGID) ?


    I need those information to look at code.

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

  • Oh I am sorry:


    • I-MSCP 1.5.1
    • FPM/FastCGI (from phpinfo)

    Additional information:
    I am using phpswitcher and have all supported versions added in the plugin.

  • @UncleSam


    So yes, you're totally right... There is a bug. The immutable flag is removed too late, hence the error:


    As you can see, we are removing the directory here: https://github.com/i-MSCP/imsc…d/apache_php_fpm.pm#L1750


    but the flag is removed later: https://github.com/i-MSCP/imsc…d/apache_php_fpm.pm#L1778


    Do you need a patch or can you wait for 1.6.x ?


    A bug report on our bugtracker would be welcome for that issue ;)

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

  • I fixed it on my own so I do not need the patch.


    For everyone having this trouble:

    • switch log mount on again
    • do a reconfigure (this time it should work)
    • go into the panel and switch the folder protection off for all domains
    • set the do not mount flag again
    • reconfigure (now it should work)
    • switch the folder protection on again
  • @UncleSam


    Can you report the issue here: https://youtrack.i-mscp.net/issues


    Thank you ;)

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

  • @UncleSam


    Thank you mate ;)

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