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 22nd November 2011, 01:31
davide.seo davide.seo is offline
Junior Member
 
Join Date: Oct 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem with cronjob

Hi all, I have a problem configuring a cron jobs in the web panel of ispconfig3 ( Site->Cron jobs ).
In the detail, after configured a cron jobs that executes every minute, in the auth.log file I see this message:

Nov 21 20:42:12 164-44 usermod[15799]: change user 'web9' home from '/var/www/clients/client0/web9' to '/var/www/clients/client0/web9/.'
Nov 21 20:42:12 164-44 usermod[15799]: change user 'web9' shell from '/bin/false' to '/usr/sbin/jk_chrootsh'
Nov 21 20:42:12 164-44 usermod[15804]: change user 'web9' home from '/var/www/clients/client0/web9/.' to '/var/www/clients/client0/web9/./home/web9'
Nov 21 20:42:12 164-44 CRON[13244]: pam_unix(cron:session): session closed for user root
Nov 21 20:43:01 164-44 CRON[15822]: pam_unix(cron:session): session opened for user web9 by (uid=0)
Nov 21 20:43:01 164-44 CRON[15823]: pam_unix(cron:session): session opened for user root by (uid=0)
Nov 21 20:43:01 164-44 jk_chrootsh[15824]: path /var/www/clients/client0/web9/./home/web9 is not owned by user 5008
Nov 21 20:43:01 164-44 jk_chrootsh[15824]: path /var/www/clients/client0/web9/./home/web9 is not owned by group 5005
Nov 21 20:43:01 164-44 jk_chrootsh[15824]: abort, path /var/www/clients/client0/web9/./home/web9 is not owned by 5008.

In the directory I see this tree:
drwx--x--- 4 web9 client0 4096 2011-10-19 20:39 web
lrwxrwxrwx 1 root root 4 2011-11-21 20:42 lib64 -> /lib
drwxr-xr-x 3 root root 4096 2011-11-21 20:42 var
drwxr-xr-x 2 root root 4096 2011-11-21 20:42 dev
drwxr-xr-x 6 root root 4096 2011-11-21 20:42 usr
drwxr-xr-x 2 root root 4096 2011-11-21 20:42 bin
drwxr-x--x 3 root root 4096 2011-11-21 20:42 lib
drwxr-x--- 3 root root 4096 2011-11-21 20:42 home
drwxr-xr-x 6 root root 4096 2011-11-21 21:13 etc



so I decide to chown the directory home:

root@webhosting:/var/www/clients/client0/web9# chown -R web9:client0 home



after this I see in the syslog file the message:
Nov 21 20:47:01 164-44 jk_chrootsh[15980]: now entering jail /var/www/clients/client0/web9 for user web9 (5008) with arguments -c /var/www/clients/client0/web9/myscript.sh

but nothing happens on the script.
But ispconfig works well only if I set http url to wget. Could you help me ?

I show also the /etc/passwd file:

web7:x:5006:5005::/var/www/clients/client0/web7/:/bin/false
web8:x:5007:5005::/var/www/clients/client0/web8:/bin/false
web9:x:5008:5005::/var/www/clients/client0/web9/./home/web9:/usr/sbin/jk_chrootsh
web10:x:5009:5005::/var/www/clients/client0/web10:/bin/false
web11:x:5010:5005::/var/www/clients/client0/web11:/bin/false
web12:x:5011:5005::/var/www/clients/client0/web12:/bin/false



Thank you
Reply With Quote
Sponsored Links
  #2  
Old 22nd November 2011, 10:00
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,733
Thanks: 840
Thanked 5,596 Times in 4,407 Posts
Default

Most likely you use commands in myscript.sh which are not installed inside the jail or you dont use full paths for the commands. Please post the content of myscript.sh.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 22nd November 2011, 11:34
davide.seo davide.seo is offline
Junior Member
 
Join Date: Oct 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi till, thank you for the reply. This is the content:

root@webhosting:/var/www/clients/client0/web9/home/web9# vi myscript.sh

/usr/bin/wget http://www.cxxxieremilano.it/xx/xxxxx/cron/cron.php
( url is clouded, wget exists in the relative path )
Calling this url from browser I should see a new parameter in the db via phpmyadmin but I don't see nothing. If I insert an echo command in the script, could I see the output in any log ?
Thanks
Reply With Quote
  #4  
Old 22nd November 2011, 11:42
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,733
Thanks: 840
Thanked 5,596 Times in 4,407 Posts
Default

The wget application is normally not installed in the jail if you use a jailed cronjob, so this script can not work.

But why do you use this script at all? ISPConfig offers URL cronjobs for that purpose and they do exactly the same then your script. So the right solution for your problem is to create a cronjob in ISPConfig and just add:

http://www.cxxxieremilano.it/xx/xxxxx/cron/cron.php

in the command field.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 22nd November 2011, 11:55
davide.seo davide.seo is offline
Junior Member
 
Join Date: Oct 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oh yes, I know that I can use the url in the cron job field but I used this script to test if the cron jobs works well.
You say that wget is not installed but I see it in the jail path:

root@webhosting:/var/www/clients/client0/web9/usr/bin# ls
awk clear dircolors du ftp head id less mawk nano nice php pico scp ssh tail vi vim.nox wc whoami
basename cut dirname find groups host ldd lesspipe md5sum netkit-ftp perl php5 rsync sort tac tr vim watch wget
root@webhosting:/var/www/clients/client0/web9/usr/bin#

Have you an idea to test the cron job functionality indipendently from my url ?
Thanks
Reply With Quote
  #6  
Old 22nd November 2011, 12:06
davide.seo davide.seo is offline
Junior Member
 
Join Date: Oct 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok...solved the problem

I inserted the command: /bin/touch pippo and it created the file
Thank you
Reply With Quote
  #7  
Old 22nd November 2011, 12:07
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,733
Thanks: 840
Thanked 5,596 Times in 4,407 Posts
 
Default

Quote:
Have you an idea to test the cron job functionality indipendently from my url ?
If you have the echo command in /var/www/clients/client0/web9/bin, then you can e.g. use such a cronjob:

echo 'test' > /tmp/test

you should find a file called test then in the tmp folder of the website. You can also verify cron by using a URL cron as I suggested, if the value in your db gets incremented, then it works.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
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
table lookup problem aurelius Installation/Configuration 5 2nd November 2011 20:12
Apache boot problem / GlusterFS loading stefanm Installation/Configuration 2 9th August 2011 15:25
ISPConfig3 Mail Warn Errors reason8 General 3 25th November 2009 14:58
BIG Problem Postfix issue admins Installation/Configuration 11 13th November 2009 11:05
Problem with mail and plugin djmostek Installation/Configuration 10 3rd September 2007 22:12


All times are GMT +2. The time now is 16:26.


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