Who execute the cron scripts?

Discussion in 'Installation/Configuration' started by vaio1, Mar 22, 2012.

  1. vaio1

    vaio1 ISPConfig Developer ISPConfig Developer

    hi guys,

    just a question: Who is the user who executes the shell scripts set in the control panel?

    thanks
     
  2. falko

    falko Super Moderator ISPConfig Developer

    It's the website user (like web1).
     
  3. vaio1

    vaio1 ISPConfig Developer ISPConfig Developer

    So I if ISPConfig uses web1 to execute a /var/www/mysite.com/web/myscript.sh script is the Max. Allowed Cronjob types (chrooted and full implies url) set as chrooted or full?

    Furthermore, how have I to check the Custom Script Logs of each script executed by ISPConfig?

    thanks falko
     
  4. falko

    falko Super Moderator ISPConfig Developer

    You must use chrooted or full as the type - URL won't work in your case.
     
  5. vaio1

    vaio1 ISPConfig Developer ISPConfig Developer

    Hi Falko,

    thanks for your reply. Infact, I am using the chrooted mode but seems to me that the script doesn't start at all.

    Is there a way to grab the log of each script executed by ISPConfig?
     
  6. vaio1

    vaio1 ISPConfig Developer ISPConfig Developer

    Hi Falko,

    this is the log information in auth.log

    Code:
    # tail /var/log/auth.log
    Mar 27 08:05:01 webserver CRON[32573]: pam_unix(cron:session): session closed for user web3415
    Mar 27 08:05:01 webserver jk_chrootsh[32596]: path /var/www/clients/client24/web56 is not owned by user 0
    Mar 27 08:05:01 webserver jk_chrootsh[32596]: path /var/www/clients/client24/web56 is not owned by group 0
    Mar 27 08:05:01 webserver jk_chrootsh[32596]: abort, /var/www/clients/client24/web56 is not a safe chroot jail.
    Mar 27 08:10:01 webserver jk_chrootsh[373]: abort, homedir '/var/www/clients/client167/web3862' for user web3862 (1100) does not contain the jail separator <jail>/./<home>
    Mar 27 08:10:01 webserver jk_chrootsh[376]: abort, /var/www/clients/client25/web3453 is not a safe chroot jail.
    
    
    
    Seems that the system doesn't have any privileges for executing the crons. Is a ISPConfig bug? I have read this article, is this problem solved: http://www.howtoforge.com/forums/showthread.php?t=53553

    thanks
     
    Last edited: Mar 27, 2012
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Which ISPConfig version do you use at the moment and with which ispconfig version did you create the cronjob?
     
  8. vaio1

    vaio1 ISPConfig Developer ISPConfig Developer

    Hi Till,

    I am started with the version 3 and now I have the 3.0.4.2.

    thanks
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    When the cronjob was created by a earlier version that had this bug then it might be that the jail is broken. First you should update to the current version 3.0.4.3 and then delete the cronjob and create a new one.
     
  10. vaio1

    vaio1 ISPConfig Developer ISPConfig Developer

    Hi Till,

    I have dozen of crons actived. Have I delete all of them?

    thanks
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    You created dozns of cronjobs and they dont work and have never worked till now?
     
  12. vaio1

    vaio1 ISPConfig Developer ISPConfig Developer

    Hi Till,

    I have updated ISPConfig and I have update all the cron entries too but I get this error:

    Code:
    jk_chrootsh[13747]: abort, homedir '/var/www/clients/client45/web101' for user web101 (1054) does not contain the jail separator <jail>/./<home>
    
    how have I to solve this problem?
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    I just checked the scripts and the jail gets only created once when the first jailed cron is created. So the best is to fix your jail manually. Please post the output of:

    grep web101 /etc/passwd
     
  14. vaio1

    vaio1 ISPConfig Developer ISPConfig Developer

    Good morning Till,

    here we go:
    # grep web101 /etc/passwd
    web101:x:1054:1045::/var/www/clients/client45/web101:/bin/false

    thanks
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Change the line to:

    web101:x:1054:1045::/var/www/clients/client45/web101/./:/bin/false
     
  16. vaio1

    vaio1 ISPConfig Developer ISPConfig Developer

    It's odd.

    I have seen the crons and seems that cron entries log is:

    Code:
    Mar 28 13:19:01 webserver CRON[2055]: pam_unix(cron:session): session opened for user root by (uid=0)
    Mar 28 13:19:01 webserver CRON[2055]: pam_unix(cron:session): session closed for user root
    
    but the default website folder permissions have :

    Code:
    /var/www/mydomain.com# ll
    total 16
    drwxr-x--x 2 web3873 client173 4096 Mar 28 11:01 cgi-bin
    lrwxrwxrwx 1 root    root        40 Mar 28 11:01 log -> /var/log/ispconfig/httpd/mydomain.com
    drwxr-x--x 2 web3873 client173 4096 Mar 28 11:01 ssl
    drwxrwxrwx 2 web3873 client173 4096 Mar 28 11:01 tmp
    drwx--x--- 4 web3873 client173 4096 Mar 28 11:01 web
    
    in this case if I attach a cron entry in the administration panel I get the error posted above, in the first post.

    So which is the right permissions of this folder?

    thanks
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    The folder permissions are fine. The cron lines you posted above are not related to the cronjob that you created, they are from the ispconfig internal cronjob and not from your user cronjob and beside that, they are success messages and not errors.
     
  18. vaio1

    vaio1 ISPConfig Developer ISPConfig Developer

    Now I get this error:
    Code:
    Mar 28 14:10:01 webserver jk_chrootsh[25571]: path /var/www/clients/client45/web101/./ is not owned by user 1054
    Mar 28 14:10:01 webserver jk_chrootsh[25571]: path /var/www/clients/client45/web101/./ is not owned by group 1045
    Mar 28 14:10:01 webserver jk_chrootsh[25571]: abort, path /var/www/clients/client45/web101/./ is not owned by 1054
    
     
  19. till

    till Super Moderator Staff Member ISPConfig Developer

    Please post the output of:

    ls -la /var/www/clients/client45/web101/home/
     
  20. vaio1

    vaio1 ISPConfig Developer ISPConfig Developer

    Code:
    # ls -la /var/www/clients/client45/web101/home/
    total 12
    drwxr-xr-x  3 root   root     4096 Mar 22 11:46 .
    drwxr-xr-x 13 root   root     4096 Mar 28 13:46 ..
    drwxr-xr-x  2 web101 client45 4096 Mar 22 11:46 web101
    
     

Share This Page