Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm having a strange problem with plesk and I can't seem to find an answer anywhere on the official support, so I hope somebody here can shed some light.

I'm simply trying to run a script via cron using the 'scheduled tasks' in the user control panel. The command is set to: php /var/www/full/path/to/script and it works on the command line.

The error message I get when it runs via cron (now that I upgraded to plesk 11) is:

user with id=xxxxx and name=xxxxxxxx not found in chrooted passwd file system error: No such file or directory

Obviously, xxxxxx is the real ID and name. The user is listed in the /etc/passwd file and looks no different to any other.

I have another domain that does a similar thing, runs a cron job hourly using the same command (but to a different script). That script runs fine, they are on the same hosting settings etc and should function identically.

Has anyone an idea what to try to do to 'fix' the user?

EDIT:

So I found this by looking around on the server: /usr/local.psa/admin/sbin/crontabmng

If I do crontabmng get on the user with the working crontab, I see at the top of the file it says SHELL=/bin/sh - wheras on the user that isn't working I see SHELL=/usr/local/psa/bin/chrootsh

It seems that even though these two users should be identical (I guess they may have been set up in different versions of plesk as upgrades have happened however they have, as far as I know, been set up using an identical process) - one of them has a chrooted shell and the other does not.

Now I just need to find out how to change that setting.....

share|improve this question

1 Answer 1

I've found an answer, even if it is a little bit "inelegant" and probably doesn't address whatever causes the problem in the first instance.

However, it may stop a few more people tearing out their hair.

The solution is to edit the crontab file for the user and change that SHELL variable, however, I have no idea where the crontabl file for the user is.

So I used these steps.

  1. /usr/local/psa/admin/sbin/crontabmng get [user] > cron.txt
  2. vi cron.txt
  3. (edit cron.txt and change the SHELL variable to /bin/sh)
  4. /usr/local/psa/admin/sbin/crontabmng set [user] cron.txt

Essentially, this dumps the crontab for that user to the cron.txt file in your current directory - where you can edit it, and use it to reload back into the crontab manager. Replace 'cron.txt' with the full path to wherever you put that file....

EDIT:

And now i've found a more permanent solution that works if you're not wanting any of your cron jobs in the chrooted shell, run this command:

/usr/local/psa/bin/server_pref -u -crontab-secure-shell /bin/sh

Read more about it from here (solution is easier to find when you know what it is you're googling for!)

share|improve this answer
    
This is for sure not a good idea. By changing the shell, you open your serve potentially to the world. chrooting make sense for security reason. You should reconsider, even if I understand your point of view about this issue. –  Akim Sissaoui May 23 '13 at 7:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.