wwwrun user cronjobs don't run
Hoping for some tips and tricks...
I want to run a script under the wwwrun user, but this seems impossible.
I'm succeeding in installing the crontab for wwwrun, but then the script scheduled doesn't seem to run.
Another problem is, that I cannot use su nor sudo to become the wwwrun user. No error message what so-ever after I try the command (as root) "su wwwrun", but after entering the "whoami" command I'm still root.
I believe these problems are related, and are quite possibly features by design and to do with system user type accounts, but (after hours of googling on the subject) I haven't found a clue how to re-configure the system to fit my purpose.
I'm experiencing this problem with OpenSuse 10.2 and SLES 9 (haven't tried other SuSE versions).
These problems don't occur when I try these similar actions under Slackware (11.0) albeit not with the same user or UID (slackware uses nobody as the user to run Apache)
After another evening trying to solve the challenge, I found a workable solution.
Just added the next line to /etc/crontab
xx yy * * * wwwrun /path/to/testscript
Specifying the user (wwwrun) to run the script at this location works
as opposed to of having a dedicated crontab for that (system)user.
I guess RTFM :study: is still of value afterall, since it was more or less just there in the Suse system documentation @ good old support.novell.com :)
Still, I keep finding it strange that it cannot be done with a dedicated crontab.
I came to believe it has something to do with PAM, something as in:
if uid < 100 then disable commands from respective crontab.
if user shell=/bin/false then prevent su to this user.
Don't have enough knowledge of PAM (nor the patience to learn PAM down to this level) though.
|All times are GMT -5. The time now is 10:21 AM.|