Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 20th December 2010, 18:07
manarak manarak is offline
Senior Member
 
Join Date: Apr 2009
Posts: 262
Thanks: 32
Thanked 6 Times in 5 Posts
Default possible bug... cron job related

I tried to setup an cronjob, and apparently it doesn't work.

I searched a bit in the logs and found the following three lines is auth.log:

server2 usermod[17924]: change user 'web7' home from '/var/www/clients/client2/web7' to '/var/www/clients/client2/web7/./var/www/clients/client2/web7'

server2 usermod[17924]: change user 'web7' shell from '/bin/false' to '/usr/sbin/jk_chrootsh'

server2 usermod[17924]: change user 'web7' home from '/var/www/clients/client2/web7/./var/www/clients/client2/web7' to '/var/www/clients/client2/web7/./home/web7'

looks very strange to me

then a bit later:

server2 jk_chrootsh[22742]: path /var/www/clients/client2/web7/./home/web7 is not owned by user 5008

server2 jk_chrootsh[22742]: path /var/www/clients/client2/web7/./home/web7 is not owned by group 5005

server2 jk_chrootsh[22742]: abort, path /var/www/clients/client2/web7/./home/web7 is not owned by 5008
Reply With Quote
Sponsored Links
  #2  
Old 20th December 2010, 18:13
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,483
Thanks: 813
Thanked 5,255 Times in 4,121 Posts
Default

Moved your post to ispconfig 3 forums.

The lines above are ok. You enabled chrooting for the user and the lines are the usermod changes required for a chrooted enviroment.

Cronjobs are working fine in ispconfig 3.0.3.1, so it dont think you found a bug. Most likely you try to execute a command which is not inside the jail.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 20th December 2010, 18:21
manarak manarak is offline
Senior Member
 
Join Date: Apr 2009
Posts: 262
Thanks: 32
Thanked 6 Times in 5 Posts
Default

hmmm...

why do the error messages then appear?

the cron job should just execute a php file situated in the webroot of web7.

what's wrong?
Reply With Quote
  #4  
Old 20th December 2010, 18:35
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,483
Thanks: 813
Thanked 5,255 Times in 4,121 Posts
Default

Quote:
why do the error messages then appear?
These are just notices from the jail creation script. They are ok.

When you use a jailed cronjob, then all apps that you want to execute have to be in the jail. The php binary is not in the jail, so executing a php file with /usr/bin/php /path/to/my/file.php will not work.

There are several possible solutions:

a) When you want to use a jail, then use a command that is available inside the jail like wget to execute the php. The php script has to be put in the web dir so that wget can fetch it with a http url.

b) install php into the jail. Thats a bit complicated as php jhas a lot of dependencies. You might want to consult the jailkit doczúmentation if you like to do this.

c) Do not enable jails for thsi website. But thats not as secure as all system commands and files that can be accessed by a normal not jailed shell user are accessible by the cronjob.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 20th December 2010, 18:41
manarak manarak is offline
Senior Member
 
Join Date: Apr 2009
Posts: 262
Thanks: 32
Thanked 6 Times in 5 Posts
Default

err..

I didn't make a conscious choice of using a jail or not, I just setup a cron job in the ISPconfig panel.

So I am a bit lost regarding the cron jobs.
Is it enough to create a cron job by writing something similar to
/usr/bin/php /var/www/clients/client2/web7/web/myscript.php
?

Or are there other things to do for this to work?

Another question:
would the creation of that cronjob cause /etc /usr /bin /var directories to appear in the user's directory under client/web7 ?

Last edited by manarak; 20th December 2010 at 18:50.
Reply With Quote
  #6  
Old 20th December 2010, 19:58
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,483
Thanks: 813
Thanked 5,255 Times in 4,121 Posts
Default

The cronjob limits are set in the client settings and get applied automatically to all websites that belong to that client.

Quote:
Is it enough to create a cron job by writing something similar to
/usr/bin/php /var/www/clients/client2/web7/web/myscript.php
This will work if the cronjob is not jailed.

Quote:
would the creation of that cronjob cause /etc /usr /bin /var directories to appear in the user's directory under client/web7 ?
If its a jailed cronjob, then yes. Otherwise, no.

The main problem now might be that a website can not unjailed by simply changing the client settings, as the jail creation affects the whole setup of the website. So even if you want to unjail the site, you should first set the "max type of cronjobs" setting in the client limits to full cron. Then edit the /etc/passwd file and change the shell of the web7 user from /usr/sbin/jk_chrootsh back to /bin/false and change the path from /var/www/clients/client2/web7/./var/www/clients/client2/web7 back to /var/www/clients/client2/web7
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 20th December 2010, 20:14
manarak manarak is offline
Senior Member
 
Join Date: Apr 2009
Posts: 262
Thanks: 32
Thanked 6 Times in 5 Posts
Default

*scratch head*
you need to make this simpler

currently, the client is set at URL cron and max cron 0 (default settings)
=> I have no idea if the cronjob is jailed, but since the directories appeared, I guess it is jailed?
=> max cron = 0, will this prevent the cron job from being executed?
(it could be useful to display the settings in the cron screen)

Sooo... but since the Cron is jailed, you say that
/usr/bin/php /var/www/clients/client2/web7/web/myscript.php
will not work.

So I should set the client to "Full cron" with a sufficent limit, right?

Last edited by manarak; 20th December 2010 at 20:21.
Reply With Quote
  #8  
Old 20th December 2010, 22:39
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,483
Thanks: 813
Thanked 5,255 Times in 4,121 Posts
Default

Quote:
So I should set the client to "Full cron" with a sufficent limit, right?
Yes, you have to set it to full cron as I wrote in my post above. The "max cron" number says only how many cronjobs the client is allowed to create.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #9  
Old 21st December 2010, 11:02
webtalk webtalk is offline
Junior Member
 
Join Date: Dec 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think you can use mailto to verify jobs functionality or execute some sort of script that gives you alert on failure or success.

here is a post on cron jobs to know more about cron thing and have a look at ispconfig manuals
__________________
best web hosting : find linux
Reply With Quote
  #10  
Old 21st December 2010, 16:44
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
 
Default

Quote:
Originally Posted by webtalk View Post
here is a post on cron jobs to know more about cron thing
Here's a short introduction to cron: http://www.howtoforge.com/a-short-in...n-to-cron-jobs
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem getting cron job to run and in need of help :) MrCompTech General 7 27th July 2010 09:50
cron job location Toucan General 6 23rd June 2010 02:36
Cron job fails kushan Server Operation 2 9th April 2010 02:52
Cron job question autogun General 2 22nd December 2009 11:54
cron job modified after upgrading V 2.2.5 jfruano Installation/Configuration 1 21st July 2006 12:31


All times are GMT +2. The time now is 13:57.


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