CRON Manager date/time


(Sarah Delfante) #1

We recently upgraded and WA was also affected by a late introduction of daylight saving at the end of last year which had to be manually administered.


We've noticed none of our CRON Manager jobs are executing. I just tested what day/time CRON Manager thinks it is by clicking the 'Next Run' button on a Linking screen and it populated the fields as 20 Dec 2006.



Solaris 10 on the server which Matrix is installed on has the correct date and time - where does CRON Manager get the date / time from?



Thanks,

Sarah


(Daniel Nitsche) #2

It sounds like your cron manager isn't running anymore. Go to the "Running Status" screen of the Cron Manager, and check there isn't a deadlock.


Then try running the matrix cron script manually (ie. the line that is in your apache/matrix user's crontab), which will be something like:


    /path/to/php /home/websites/mysource_matrix/core/cron/run.php


You should make sure there is not an existing matrix/php cron job process running.

(Sarah Delfante) #3

Thanks yeah there was a deadlock.

[quote]Then try running the matrix cron script manually (ie. the line that is in your apache/matrix user's crontab), which will be something like:
    /path/to/php /home/websites/mysource_matrix/core/cron/run.php

You should make sure there is not an existing matrix/php cron job process running.
[right][post="15249"]<{POST_SNAPBACK}>[/post][/right][/quote]

Done this. CRON Manager wasn't enabled and there weren't any jobs scheduled.
Now when logging in as root we get the following warnings:

PHP Warning
File: /mnt[SYSTEM_ROOT]/core/include/general.inc Line: 965
Message: fopen([SYSTEM_ROOT]/data/private/logs/system.log): failed to open stream: Permission denied
Backtrace: Show

PHP Warning
File: /mnt[SYSTEM_ROOT]/core/include/general.inc Line: 966
Message: fwrite(): supplied argument is not a valid stream resource
Backtrace: Show

MySource Warning
File: /mnt[SYSTEM_ROOT]/core/include/general.inc Line: 967
Message: Unable to Write to log file [SYSTEM_ROOT]/data/private/logs/system.log [SYS0051]
Backtrace: Show

PHP Warning
File: /mnt[SYSTEM_ROOT]/core/include/mysource.inc Line: 663
Message: Cannot modify header information - headers already sent by (output started at /mnt[SYSTEM_ROOT]/core/include/general.inc:175)
Backtrace: Show


If we alter the URL to remove everythign after /_admin we can access OK until we logout - then we get the warnings again. And when we try to log back in.

Any ideas?

Thanks

(Sarah Delfante) #4

Also on the Cron Manager Running Status screen it says it is not running despite running the script.


(Daniel Nitsche) #5

Yes, that would be my fault in not being clear enough sorry :slight_smile:


You need to run the cron command above, as the user who normally runs it (typically something like "apache", "www-data" or "matrix").



It looks like you've run it as root (or some other user) which means this user now has ownership of the files, and Matrix can't update its logs.



Check the permissions on your filesystem are ok (especially the data/private/logs directory), and chown back to the user that runs Matrix where appropriate.


(Avi Miller) #6

(Heh, I got beaten by Dan to a reply. It had to happen eventually…)


(Daniel Nitsche) #7

[quote]Also on the Cron Manager Running Status screen it says it is not running despite running the script.
[right][post=“15253”]<{POST_SNAPBACK}>[/post][/right][/quote]



Has the “last run” updated if you view the “View jobs” screen on the Cron Manager?



Also, can you post the contents of your crontab?


(Daniel Nitsche) #8

[quote](Heh, I got beaten by Dan to a reply. It had to happen eventually…)
[right][post=“15256”]<{POST_SNAPBACK}>[/post][/right][/quote]



Dan: 1

Avi: 1307



:slight_smile:


(Sarah Delfante) #9

Thanks - running the script as the correct user has removed the warnings. It still says 'No' for 'Running' on the Running Status screen…

[quote]Has the "last run" updated if you view the "View jobs" screen on the Cron Manager?[/quote]

… But you're right it is updating - last run at 14:45 (we're on WST). Does this mean it is on even though it next to 'Running' it says 'No'?


[quote]Also, can you post the contents of your crontab?

[right][post=“15257”]<{POST_SNAPBACK}>[/post][/right][/quote]



Not sure what info you mean - on what screen?


(Luke Wright) #10

[quote]… But you’re right it is updating - last run at 14:45 (we’re on WST). Does this mean it is on even though it next to ‘Running’ it says ‘No’?
[right][post=“15259”]<{POST_SNAPBACK}>[/post][/right][/quote]



If the “Running” field says “No”, it just means that the Cron script is not currently running at the moment (ie. when the Cron script is activated, it will say “Yes”, then when it finishes, it’ll set it back to “No”). If your last run time is being updated, the Cron script is running properly.


(Daniel Nitsche) #11

That's what it should say. 'No' indicates it's not running at this very moment -- this is useful to know, because it should only run for a brief moment (eg. less than 30 seconds).

[quote]Not sure what info you mean - on what screen?
[right][post="15259"]<{POST_SNAPBACK}>[/post][/right][/quote]

The crontab is a list of all the cron jobs and when they should run for a particular user on your Solaris box.

You can normally view the crontab of the user you are logged in as using:

    crontab -l


you can also view another user's crontab, but I can't remember the exact syntax (possible -U apache).

(Sarah Delfante) #12

[quote]That’s what it should say. ‘No’ indicates it’s not running at this very moment – this is useful to know, because it should only run for a brief moment (eg. less than 30 seconds).
[right][post=“15262”]<{POST_SNAPBACK}>[/post][/right][/quote]



OK it is all making sense now… The date/time when using the ‘Next run’ option is now correct. Have a test job setup for 15:15…


(Sarah Delfante) #13

All working - thanks for all your help! :smiley: