CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • templates_c directory flooded with %% directories owned by root
Pages: [1]

Author Topic: templates_c directory flooded with %% directories owned by root  (Read 800 times)

jern

  • I post occasionally
  • **
  • Posts: 46
  • Karma: 0
    • SEN Magazine
  • CiviCRM version: 4.5.8
  • CMS version: Joomla 2.5.28
  • MySQL version: 5.5.40
  • PHP version: 5.4.33
templates_c directory flooded with %% directories owned by root
November 19, 2014, 12:32:26 pm
This is a strange thing. The templates_c/en_US/en_GB directory is fine for a while, containing %% directories owned by the web-server user. But then it suddenly fills with hundreds of directories owned by root. At this point, CiviCRM stops working. If I delete all the %% folders from en_GB, then all is back to normal; new %% directories are created as normal, owned by the web server user, until at some point the flood of root-owned folders starts again and fills up to %%FF.

How can CiviCRM be creating directories owned by root? More to the point, how can I stop it? Thanks.

jern

  • I post occasionally
  • **
  • Posts: 46
  • Karma: 0
    • SEN Magazine
  • CiviCRM version: 4.5.8
  • CMS version: Joomla 2.5.28
  • MySQL version: 5.5.40
  • PHP version: 5.4.33
Re: templates_c directory flooded with %% directories owned by root
November 21, 2014, 12:29:01 am
UPDATE:

I have tracked the problem down to the job Update Individual Addressees, which was set to run hourly. Running this job seems to trigger the filling of the templates_c directory with 256 %% directories (with root permissions) within a very short time (less than a minute).  I disabled the job, and the problem has stopped.

Not sure if it's a problem with our installation, or with the job parameters (ct=Individual, gt=addressee, force=1), but this seems unlikely. The demo site is only version 4.4, so I can't test it there (the problem has only appeared since 4.5.3).

Should I report this as a bug? What concerns me most is that CiviCRM is able to create directories with root permissions - how can this be possible? Surely nothing in Civi has root permissions?
« Last Edit: November 21, 2014, 12:20:20 pm by jern »

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: templates_c directory flooded with %% directories owned by root
November 24, 2014, 12:46:02 am
Quote
Surely nothing in Civi has root permissions?
That depends on how you have set things up
Quote
The demo site is only version 4.4
There are 4.4, 4.5 and master versions of the demo sites, e.g. d44.demo.civicrm.org, d45.demo.civicrm.org, dmaster.demo.civicrm.org
Quote
How can CiviCRM be creating directories owned by root?
I suspect this happens because your cron jobs are running as root. You might want to change the user to www-data or similar.
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: templates_c directory flooded with %% directories owned by root
November 24, 2014, 12:46:42 am
PS not sure that is going to solve your problem, but a good first step. Let us know how you get on, please :)
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

calbasi

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
    • calbasi.net
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.1
  • PHP version: 5.3
Re: templates_c directory flooded with %% directories owned by root
November 26, 2014, 05:36:08 am
I've got this issue too, in a 4.4.7 CiviCRM...

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: templates_c directory flooded with %% directories owned by root
November 26, 2014, 07:24:34 am
calbasi,

I think Michael's response, that this is most likely caused by your cron job running as root, is very likely your issue.  When you check that, would you be able to report back here what you found?  Thanks!

Jon
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

jern

  • I post occasionally
  • **
  • Posts: 46
  • Karma: 0
    • SEN Magazine
  • CiviCRM version: 4.5.8
  • CMS version: Joomla 2.5.28
  • MySQL version: 5.5.40
  • PHP version: 5.4.33
Re: templates_c directory flooded with %% directories owned by root
December 01, 2014, 09:41:01 am
Hi, thanks. Sorry for delay. I double checked - the cron job runs under the normal admin username which I used for installing CiviCRM. Not a root in sight.

Maybe the problem was the use of the "force=1" option. I will reactivate with force=0 and see if the error still happens.

Still doesn't explain how the %% directories are being created with root permissions, though.

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: templates_c directory flooded with %% directories owned by root
December 01, 2014, 11:09:23 am
Quote
Maybe the problem was the use of the "force=1" option. I will reactivate with force=0 and see if the error still happens.
Pretty sure that will not affect it.
Quote
Hi, thanks. Sorry for delay. I double checked - the cron job runs under the normal admin username which I used for installing CiviCRM. Not a root in sight.
How exactly are you calling the cron?
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

jern

  • I post occasionally
  • **
  • Posts: 46
  • Karma: 0
    • SEN Magazine
  • CiviCRM version: 4.5.8
  • CMS version: Joomla 2.5.28
  • MySQL version: 5.5.40
  • PHP version: 5.4.33
Re: templates_c directory flooded with %% directories owned by root
March 05, 2015, 12:59:24 am
...after lengthy pause...

calling cron from the system crontab, which I guess means that the cron job is running with root privileges.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • templates_c directory flooded with %% directories owned by root

This forum was archived on 2017-11-26.