I keep getting this as a warning whenever I verify a site

CommentFileSizeAuthor
#13 mkdir_permission-2693795-13.patch675 byteshelmo
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

SocialNicheGuru created an issue. See original summary.

ergonlogic’s picture

Project: Provision » Aegir Hosting Logs
Version: 7.x-3.4 » 7.x-3.x-dev

I'm pretty sure this isn't part of Aegir core. I believe the relevant code lives in hosting_logs.

helmo’s picture

That means you don't have the '/var/log/aegir' directory. You'll have to create that dir as the root user.

This code was created when the default was to create the log dir under /var/aegir, where we do have write access. However that has other security implications.

The README mentions that the dir needs to be created ... but maybe we need to add that to the UI too.

  • helmo committed 97f0091 on 7.x-3.x
    Issue #2693795: Add message after being enabled to point to the README
    
helmo’s picture

Status: Active » Fixed

I've now added a hook to display a message just after enabling this module to point to the README.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ergonlogic’s picture

I think this issue needs to be re-opened. This functionality remains buggy:

$log_path = drush_get_option('provision_logs_path', '/var/log/aegir');

The provision_logs_path option doesn't seem to get set anywhere on the backend, though there's a front-end field to set it. So I think this module only works if you use the default.

Also, later, we seem to check a different option:

$log_file_path = drush_get_option('provision_logs_file_path', '/var/log/aegir');

The line in that actually throws that warning is calling mkdir(), but we now assume that an admin will create the directory, so perhaps this should be a chmod() instead? Also, provision_file()->chmod() is the usual mechanism for handling filesystem operations.

helmo’s picture

Status: Closed (fixed) » Needs work

per #7

mkdir of '/var/log/aegir' will almost always fail :(

ergonlogic’s picture

Also of note: I believe that I was seeing these warnings when the module was present but not yet enabled. I
ll try to confirm this.

colan’s picture

Priority: Normal » Major

Just got this on an upgrade to the Aegir release.

I don't even have this module enabled so I'm not sure why I'm running into this when verifying the Hostmaster site.

AlfTheCat’s picture

@ergonlogic

Yes, I just did a fresh aegir install and got the warning when the module wasn't enabled. The warning went away after installing and following Readme instructions.

colan’s picture

I ran the following, and was able to cleanly verify the hostmaster site:

sudo mkdir /var/log/aegir

This works without having to enable the module.

Can we put this in the release notes, that that directory has to be created before upgrading?

helmo’s picture

Status: Needs work » Needs review
FileSize
675 bytes

This patch gets rid of the warning by checking if we can write to it.

An alternative is to just remove the whole hook... as the only case where I see this as potentially being used is when you change the provision_logs_path variable.

Jon?

PS: I've added a line to the release notes.

helmo’s picture

The reason why this came up even when the hosting_logs module is not enabled is #2917495: Drush includes code from not enabled modules

  • helmo committed 72d1fac on 7.x-3.x
    Issue #2693795 by helmo, ergonlogic, colan, SocialNicheGuru, AlfTheCat:...
helmo’s picture

Assigned: Unassigned » Jon Pugh
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.