XML Sitemaps Generator

Author Topic: Different User Rights  (Read 8567 times)

majunke

  • Registered Customer
  • Approved member
  • *
  • Posts: 9
Different User Rights
« on: March 08, 2011, 06:03:09 PM »
Hello,

i installed the tool and basicly it works fine. But now i would use it with as a cron Job, but there is a user problem.

With Web-Fronend the User "nobody" is used ( i think Apache User from my Hoster ) - e.g. the data/generator.conf is created with this user.
I use the Parameter "use temporary files to store crawling progress" and if i do a crawling process (with the web frontend) all files stored as User "nobody".
Now comes the Cron Job and this is not nobody ! So this job can NOT update,replace,.. the data/process Files.

What can i do ? I can not change the cron- or WebUser.

For now, i clean all Files and not using Actions with the Web-Frontend.. is there another solution for this User-Right-Problem ?  ( Sticky Bit ?? )

Greetings
Michael

PS.: sorry.. my english is not the best  :(
« Last Edit: March 08, 2011, 06:04:51 PM by majunke »

XML-Sitemaps Support

  • Administrator
  • Hero Member
  • *****
  • Posts: 10624
Re: Different User Rights
« Reply #1 on: March 09, 2011, 11:09:21 AM »
Hello,

you can also set all files permissions to 0666 to allow them to be modified in both cases.
Oleg Ignatiuk
www.xml-sitemaps.com
Send me a Private Message

For maximum exposure and traffic for your web site check out our additional SEO Services.

majunke

  • Registered Customer
  • Approved member
  • *
  • Posts: 9
Re: Different User Rights
« Reply #2 on: March 09, 2011, 04:51:03 PM »
Hello,

the problem is at first time there is no file on which i can set Permissions. The data/process folder is created from the first user who start the crawling. Another example is the sitemap.html, sitemap2.html (..). The cron User create this sitemapX Files, but in Frontend i can't read them because the cron-User umask is 022 . For now, i reset Permissions on existing files to 0666, but so i never can read new Files in frontend without doing this.

I'm affraid it gives not a solution ?

Greetings
Micha

PS.: the preview feature of this forum editor does not work

XML-Sitemaps Support

  • Administrator
  • Hero Member
  • *****
  • Posts: 10624
Re: Different User Rights
« Reply #3 on: March 11, 2011, 12:00:35 AM »
Hello,

you can create an additional shell script to run generator cron task like:
chmod -r 0666 /path/generator/data/*
/usr/bin/php /path/generator/runcrawl.php
chmod -r 0666 /path/generator/data/*
Oleg Ignatiuk
www.xml-sitemaps.com
Send me a Private Message

For maximum exposure and traffic for your web site check out our additional SEO Services.

majunke

  • Registered Customer
  • Approved member
  • *
  • Posts: 9
Re: Different User Rights
« Reply #4 on: March 11, 2011, 05:48:13 PM »

ah, yes.. i dont see the easiest way ;)

I do it so:
Code: [external links are visible to admins only]
chmod -Rf a+wr xxx/data/* > xxx/crawlWrapper.log
/usr/local/bin/php xxx/runcrawl.php >> xxx/crawlWrapper.log
chmod -Rf a+wr xxx/data/* >> xxx/crawlWrapper.log
rm -rf xxx/data/sess_* >> xx/crawlWrapper.log
because the 0666 remove the x on data/progress.

So the cron User now create the Files and the 'nobody' User can read this in the xml-sitemap-Frontend. The qay to start crawling by frontend i don't need.
( hmm.. so i think i can also do chmod a+r  )

( The rm is because the sess_ Files are not cleaned.. )

Thanks for help..
Michael

PS.: now the preview feature in this forum works fine :)

 

SMF 2.0.12 | SMF © 2014, Simple Machines
XHTML RSS WAP2