HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   ISPC 3.0.4.5: Cron Jobs don't work (http://www.howtoforge.com/forums/showthread.php?t=57726)

manarak 25th June 2012 00:27

ISPC 3.0.4.5: Cron Jobs don't work
 
Hi, I have trouble with the cron jobs.

I have installed ISPC on debian squeeze following falko's perfect server How-To (thanks!)

I created the cron job in ISPC config under the proper user (web7)

syslog is telling me the following:
Quote:

Jun 24 17:05:01 bababobo1 /USR/SBIN/CRON[23877]: (web7) CMD (/usr/bin/php /var/www/clients/client1/web7/web/cronjobs/il_test.php^I#domain)
Jun 24 17:05:01 bababobo1 /USR/SBIN/CRON[23871]: (CRON) error (grandchild #23877 failed with exit status 17)
I also tried to change /usr/bin/php into /var/www/clients/client1/web7/usr/bin/php but the log stays the same, I presume both resolve to the chrooted shell.

Exit status 17 baffles me a little, according to
http://www.visualcron.com/ExitCodes.aspx
it means "The system cannot move the file to a different disk drive." ??
(even more baffling, I was unable to find another cron exit codes list on the internet)

Anyway, I don't know what's wrong.

I checked the log in /var/log/ispconfig/cron.log, and it says:
Quote:

mkdir: cannot create directory `/var/www/clients/client1/web7/var': File exists
mkdir: cannot create directory `/var/www/clients/client1/web7/var/run': File exists
usermod: user web7 is currently logged in
failed to execute usermod -d /var/www/clients/client1/web7/. -s /usr/sbin/jk_chrootsh web7
failed to modify user web7
usermod: user web7 is currently logged in
usermod: unlocking the user's password would result in a passwordless account.
You should set a password with usermod -p to unlock this user's password.
usermod: user web7 is currently logged in
failed to execute usermod -d /var/www/clients/client1/web7/. -s /usr/sbin/jk_chrootsh web7
failed to modify user web7
usermod: user web7 is currently logged in
PHP Warning: mkdir(): File exists in /usr/local/ispconfig/server/plugins-available/cron_jailkit_plugin.inc.php on line 293
usermod: user web7 is currently logged in
failed to execute usermod -d /var/www/clients/client1/web7/. -s /usr/sbin/jk_chrootsh web7
failed to modify user web7
usermod: user web7 is currently logged in
PHP Warning: mkdir(): File exists in /usr/local/ispconfig/server/plugins-available/cron_jailkit_plugin.inc.php on line 293
usermod: unlocking the user's password would result in a passwordless account.
You should set a password with usermod -p to unlock this user's password.
I have no idea what these things mean and if that is the cause of my crons not working.
Who can help?
Thank you

manarak 25th June 2012 00:37

grep web7 /etc/passwd outputs:

Quote:

web7:x:5010:5006::/var/www/clients/client1/web7:/bin/false

till 25th June 2012 09:33

Quote:

I also tried to change /usr/bin/php into /var/www/clients/client1/web7/usr/bin/php but the log stays the same, I presume both resolve to the chrooted shell.
Please undo that as there is no php binary in the jail.

If you want to execute a php script, then put it into the web folder of the website and then enter the URL starting with http://..... into the cron command field.

manarak 25th June 2012 12:19

the file
/var/www/clients/client1/web7/usr/bin/php
does exist

I tried just putting http:// path to the script, but it doesn't work either. CRON now exits with code 8 "not enough storage" ??

manarak 25th June 2012 13:15

hmmm... I edited /etc/crontab and put it there to run under user web7, and sure enough it ran.

so why doesn't it run when set inside ISPConfig?

Croydon 25th June 2012 13:32

Did you have a look into the /etc/cron.d/ispc_webXX or ispc_chrooted_webX file? Everything correct in there?

manarak 25th June 2012 13:41

it *looks* correct:

Quote:

MAILTO=''
SHELL='/usr/sbin/jk_chrootsh'
* * * * * web7 /usr/bin/php /var/www/clients/client1/web7/web/cronjobs/il_test.php #domain
(domain being the domain setup on web7)

till 25th June 2012 13:46

The path to the php script is wrong, it has to be:

/web/cronjobs/il_test.php

and not:

/var/www/clients/client1/web7/web/cronjobs/il_test.php

when you call a script inside the jail.

Croydon 25th June 2012 14:11

Quote:

Originally Posted by till (Post 281115)
The path to the php script is wrong, it has to be:

/web/cronjobs/il_test.php

and not:

/var/www/clients/client1/web7/web/cronjobs/il_test.php

when you call a script inside the jail.

Just to be a bit off-topic:
Maybe this could be automatically done by ISPC when using a chrooted cron. Just replace all "web root" paths with /

manarak 25th June 2012 14:30

ok, I tried /usr/bin/php /web/cronjobs/il_test.php

and also just /web/cronjobs/il_test.php

neither works, both exit with code 17.


All times are GMT +2. The time now is 06:29.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.