• Welcome to Sitemap Generator Forum.
 

Different User Rights

Started by majunke, March 08, 2011, 06:03:09 PM

Previous topic - Next topic

majunke

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  :(

XML-Sitemaps Support

Hello,

you can also set all files permissions to 0666 to allow them to be modified in both cases.

majunke

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

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/*

majunke


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

I do it so:
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 :)