Cron is not transfered to /etc/cron.d

Discussion in 'Installation/Configuration' started by Stelios, Nov 28, 2020.

Tags:
  1. Stelios

    Stelios Active Member HowtoForge Supporter

    Hi,

    On a new server running 3.2.1 crons are not adding under /etc/cron.d at all.
    They adding without a problem via the GUI but they don't get created under /etc/cron.d (it is empty the directory, no ispc_whatever inside).

    /var/log/ispconfig/cron.log shows no problems:
    Sat 28 Nov 2020 09:16:02 PM EET finished server.php.

    /var/log/ispconfig/ispconfig.log is also empty.

    This is a multi-server setup and the above output is from a server running only as a web server (no other services).

    PS: If I manually create a file inside cron.d ,is it going to be executed normally?
     
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Enabled debug mode and run server.sh manually. You might also check that the appropriate server plugin is enabled to create those cron jobs (I don't know what it is called).
     
  3. Stelios

    Stelios Active Member HowtoForge Supporter

    Hi,

    I don't understand what you are saying to check that server plugin is enabled? In case you mean the cron; the user has it as a full cron.
    I'm getting via the debug a Parent domain not found, see output below:

    Code:
    root@web3:~# /usr/local/ispconfig/server/server.sh
    29.11.2020-07:37 - DEBUG - Calling function 'check_phpini_changes' from plugin 'webserver_plugin' raised by action 'server_plugins_loaded'.
    29.11.2020-07:37 - DEBUG - Found 2 changes, starting update process.
    29.11.2020-07:37 - DEBUG - Replicated from master: REPLACE INTO `cron` (`id`,`sys_userid`,`sys_groupid`,`sys_perm_user`,`sys_perm_group`,`sys_perm_other`,`server_id`,`parent_domain_id`,`type`,`command`,`run_min`,`run_hour`,`run_mday`,`run_month`,`run_wday`,`log`,`active`) VALUES ('25','1','8','riud','riud','','11','69','full','/usr/bin/php /var/www/clients/client5/web69/private/phplist -pprocessqueue > /dev/null 2>&1','0-59/6','*','*','*','*','y','y')
    29.11.2020-07:37 - DEBUG - Calling function 'update' from plugin 'cron_jailkit_plugin' raised by event 'cron_update'.
    29.11.2020-07:37 - WARNING - Parent domain not found
    29.11.2020-07:37 - DEBUG - Calling function 'update' from plugin 'cron_plugin' raised by event 'cron_update'.
    29.11.2020-07:37 - WARNING - Parent domain not found
    29.11.2020-07:37 - DEBUG - Processed datalog_id 3505
    29.11.2020-07:37 - DEBUG - Replicated from master: REPLACE INTO `cron` (`id`,`sys_userid`,`sys_groupid`,`sys_perm_user`,`sys_perm_group`,`sys_perm_other`,`server_id`,`parent_domain_id`,`type`,`command`,`run_min`,`run_hour`,`run_mday`,`run_month`,`run_wday`,`log`,`active`) VALUES ('26','1','8','riud','riud','','11','69','full','/usr/bin/php /var/www/clients/client5/web69/private/phplist -pprocessbounces > /dev/null 2>&1','0','3','*','*','*','y','y')
    29.11.2020-07:37 - DEBUG - Calling function 'update' from plugin 'cron_jailkit_plugin' raised by event 'cron_update'.
    29.11.2020-07:37 - WARNING - Parent domain not found
    29.11.2020-07:37 - DEBUG - Calling function 'update' from plugin 'cron_plugin' raised by event 'cron_update'.
    29.11.2020-07:37 - WARNING - Parent domain not found
    29.11.2020-07:37 - DEBUG - Processed datalog_id 3506
    29.11.2020-07:37 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    finished server.php.
    root@web3:~# 
     
  4. Stelios

    Stelios Active Member HowtoForge Supporter

    The main domain of ths site is mydomain.com and is hosted on serverA.
    A subdomain newsletter.mydomain.com is hosted on serverB.
    The problem and output of the above are for the subdomain in case it helps as it seems maybe related to that parent domain not found?
    It looks like it is looking the main domain to be hosted on the same server?
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    A subdomain can never be located on a different server than the main domain, at least not when it is not a separate website.
     
  6. Stelios

    Stelios Active Member HowtoForge Supporter

    It has been created as separate web site.
     
  7. Stelios

    Stelios Active Member HowtoForge Supporter

    This is getting really bizarre.

    I gave up with ISPconfig cron; I tried many things nothing worked.
    I then added manually the cron by using as root crontab -e

    The command to run every 5 minutes is:
    */5 * * * * /var/www/clients/client5/web69/private/phplist -pprocessqueue > /dev/null 2>&1

    Under the cron log I can see that is executing but it doesn't actually run the code that I got inside the file.
    Code:
    root@web3:~# tail -f /var/log/cron.log
    Nov 29 21:50:01 web3 CRON[29820]: (root) CMD (/var/www/clients/client5/web69/private/phplist -pprocessqueue > /dev/null 2>&1)
    I'm sure that is not running the code as if that was happening it will update a web page that I monitor the results (is a mailing list and use the script to send the emails).
    Now when I just copy-paste the command in terminal it works fine.....this is the code of the executable file:
    Code:
    root@web3:~# cat /var/www/clients/client5/web69/private/phplist
    #!/bin/bash
    /usr/bin/php /var/www/clients/client5/web69/web/admin/index.php -c /var/www/clients/client5/web69/web/config/config.php $*
    Any help is very much appreciated.
     
  8. Stelios

    Stelios Active Member HowtoForge Supporter

    Finally I found it....for some reason(?) it needed to define the USER variable. Running the above worked:
    export USER=root && /var/www/clients/client5/web69/private/phplist -pprocessqueue > /dev/null 2>&1
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    That's ok then. You can use debug mode to find out why the corn file could not be added.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    That's really dangerous, the user which owns that site, or someone who might be able to hack the website, can now easily take over your server and become root user. Better undo your root cronjob and use debug mode to find out why the job could not be created by ISPConfig.
     
  11. Stelios

    Stelios Active Member HowtoForge Supporter

    The root cron was temp; it is running as user now.
    I've posted above the debug output, here it is again:
    Code:
    root@web3:~# /usr/local/ispconfig/server/server.sh
    29.11.2020-07:37 - DEBUG - Calling function 'check_phpini_changes' from plugin 'webserver_plugin' raised by action 'server_plugins_loaded'.
    29.11.2020-07:37 - DEBUG - Found 2 changes, starting update process.
    29.11.2020-07:37 - DEBUG - Replicated from master: REPLACE INTO `cron` (`id`,`sys_userid`,`sys_groupid`,`sys_perm_user`,`sys_perm_group`,`sys_perm_other`,`server_id`,`parent_domain_id`,`type`,`command`,`run_min`,`run_hour`,`run_mday`,`run_month`,`run_wday`,`log`,`active`) VALUES ('25','1','8','riud','riud','','11','69','full','/usr/bin/php /var/www/clients/client5/web69/private/phplist -pprocessqueue > /dev/null 2>&1','0-59/6','*','*','*','*','y','y')
    29.11.2020-07:37 - DEBUG - Calling function 'update' from plugin 'cron_jailkit_plugin' raised by event 'cron_update'.
    29.11.2020-07:37 - WARNING - Parent domain not found
    29.11.2020-07:37 - DEBUG - Calling function 'update' from plugin 'cron_plugin' raised by event 'cron_update'.
    29.11.2020-07:37 - WARNING - Parent domain not found
    29.11.2020-07:37 - DEBUG - Processed datalog_id 3505
    29.11.2020-07:37 - DEBUG - Replicated from master: REPLACE INTO `cron` (`id`,`sys_userid`,`sys_groupid`,`sys_perm_user`,`sys_perm_group`,`sys_perm_other`,`server_id`,`parent_domain_id`,`type`,`command`,`run_min`,`run_hour`,`run_mday`,`run_month`,`run_wday`,`log`,`active`) VALUES ('26','1','8','riud','riud','','11','69','full','/usr/bin/php /var/www/clients/client5/web69/private/phplist -pprocessbounces > /dev/null 2>&1','0','3','*','*','*','y','y')
    29.11.2020-07:37 - DEBUG - Calling function 'update' from plugin 'cron_jailkit_plugin' raised by event 'cron_update'.
    29.11.2020-07:37 - WARNING - Parent domain not found
    29.11.2020-07:37 - DEBUG - Calling function 'update' from plugin 'cron_plugin' raised by event 'cron_update'.
    29.11.2020-07:37 - WARNING - Parent domain not found
    29.11.2020-07:37 - DEBUG - Processed datalog_id 3506
    29.11.2020-07:37 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    finished server.php.
    root@web3:~# 
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    There seems to be a corruption / missing data on the slave node. Maybe you restored an old version of the ispconfig database somewhere in the parts which lacks some data or something similar. The error means that the database has no record for this website. Check the database of that slave node if it contains a record for this website in web_domain table.
     
  13. Stelios

    Stelios Active Member HowtoForge Supporter

    This was a new server that added to my multi-server setup, no migrations or restores at all.
    The table doesn't have the subdomain at all. Is it possible to run a query to create it manually or with any other way?
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    Open the website settings, change a value e.g. quota. and press save. Is this a mirrored slave server that you added? If yes, then you might have to run Tools > resync for the master of this mirror as a mirrored slave can't be added at a later time normally and if you do it anyway, then you must resync all data as a mirror receives only changes, so all data that has been added to its master before will not be present.
     
  15. Stelios

    Stelios Active Member HowtoForge Supporter

    That server acts as a standalone server, no mirroring of anything.
     
  16. Stelios

    Stelios Active Member HowtoForge Supporter

    Changing the quota fixed the error, the cron afterwards worked fine.
    Thanks a lot
     

Share This Page