Koozali.org: home of the SME Server

locale error with srktimer

Offline compsos

  • *
  • 472
  • +0/-0
locale error with srktimer
« on: August 19, 2011, 12:44:39 PM »
Hi
sme 8.0B6
Sark  sail-3.1.0-128

The upgrade of zarafa 6 to 7 seems to have upset srktimer.php. It is sending an email every minute containing
Code: [Select]
Warning: Terminal locale not UTF-8, but UTF-8 locale is being forced. Screen output may not be correctly printed.
I have stopped zarafa error on starting zarafa by editing the /etc/sysconfig/zarafa file. Is there something similar for the srktimer routine?

Thanks.
« Last Edit: August 20, 2011, 12:57:26 AM by compsos »
Regards

Gordon............

Offline compsos

  • *
  • 472
  • +0/-0
Re: locale error with srktimer
« Reply #1 on: August 20, 2011, 08:53:23 AM »
Ok a bit more testing and more fustration.

A bit on the UTF-8 verse UTF8
http://jeremy.zawodny.com/blog/archives/010546.html

The error is coming from the cron event calling the file srktimer.php. With an echo command in the start of the file it prints at the end of the email.

Also with zarafa it will throw the same warning if the /etc/sysconfig/zarafa file's language settings do not use uppercase "UTF-8". "uft-8" will cause the error loading zarafa-monitor. Apart from the 60 emails per hour the error does not seem to affect anything. So far have not seen any other programs other than srktimer and zarafa-monitor. Is this a perl or php related issue? Can we change the cron srktimer event off every minute? It appears to be only testing open close periods for incoming call management.

looking at the cron log perl does not throw the error only the php
Code: [Select]
Aug 19 20:30:01 server crond[9238]: (root) CMD (perl /opt/sark/scripts/srkrestrtdm.pl)
Aug 19 20:30:01 server crond[9240]: (root) CMD (php /opt/sark/generator/srktimer.php)
Aug 19 20:30:01 server crond[9241]: (root) CMD (perl /opt/sark/scripts/perlarp.pl)
Aug 19 20:30:01 server crond[9242]: (root) CMD (/usr/lib/sa/sa1 1 1)
Aug 19 20:31:01 server crond[9535]: (root) CMD (perl /opt/sark/scripts/srkrestrtdm.pl)
Aug 19 20:31:01 server crond[9536]: (root) CMD (php /opt/sark/generator/srktimer.php)
Aug 19 20:32:01 server crond[9810]: (root) CMD (perl /opt/sark/scripts/srkrestrtdm.pl)
Aug 19 20:32:01 server crond[9811]: (root) CMD (php /opt/sark/generator/srktimer.php)
Aug 19 20:33:01 server crond[10083]: (root) CMD (php /opt/sark/generator/srktimer.php)
Aug 19 20:33:01 server crond[10084]: (root) CMD (perl /opt/sark/scripts/srkrestrtdm.pl)
Aug 19 20:34:01 server crond[10351]: (root) CMD (perl /opt/sark/scripts/srkrestrtdm.pl)
Aug 19 20:34:01 server crond[10352]: (root) CMD (php /opt/sark/generator/srktimer.php)
Aug 19 20:35:01 server crond[10687]: (root) CMD (perl /opt/sark/scripts/srkrestrtdm.pl)
Aug 19 20:35:01 server crond[10689]: (root) CMD (php /opt/sark/generator/srktimer.php)

Any suggestions on the best way to debug and trap the source as it happens?
Regards

Gordon............

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: locale error with srktimer
« Reply #2 on: August 20, 2011, 09:08:54 PM »
Quote
The upgrade of zarafa 6 to 7 seems to have upset srktimer.php. It is sending an email every minute...

What is sending an email every minute? 
What suggests the error message is related to srktimer.php?

The timer runs once a minute and compares the timer chains with TOD.  It generates a boolean for each timer chain corresponding to "open" or "closed" and saves it into the database.   The only failure condition it recognises is a failure to open the db. 

If you think it is causing a problem then you can run it manually to see what, if any, output it gives.

Code: [Select]
php /opt/sark/generator/srktimer.php
Kind Regards

S

Offline compsos

  • *
  • 472
  • +0/-0
Re: locale error with srktimer
« Reply #3 on: August 21, 2011, 01:38:49 AM »
Hi Jeff
I now believe it is not srktimer but the calling of php routines in general. I have found sites with the same issue that are not SME or Sail or CentOS based. So it is something that zarafa ver 7 has "added" or modified that has brought out the issue.

The running manually of srktimer returned
Code: [Select]
Warning: Terminal locale not UTF-8, but UTF-8 locale is being forced.
         Screen output may not be correctly printed.

srktimer was in the sights only because it called every minute by cron. Running other php scripts from the console produces the same result.

Just have not figured out the statement "but UTF-8 locale is being forced". Forced by what?
Regards

Gordon............

Offline compsos

  • *
  • 472
  • +0/-0
Re: locale error with srktimer
« Reply #4 on: August 21, 2011, 10:34:01 AM »
This looks like it works. If someone knows how to template the file please advise.

Edit the /etc/sysconfig/i18n change LANG and add a line SUPPORTED

Code: [Select]
LANG="en_US.UTF-8"
SUPPORTED="en_US.UTF-8:en_US:en"

Changing the db config sysconfig Language was changed back with either post-upgrade or console-save. Looking at the template fragments for i18n file they do not appear to be reading the db.
Template-begin code
Code: [Select]
{
{
    %settings = ();
    %order = ();
    $OUT = "";
    if (open(I18N, "/etc/sysconfig/i18n"))
    {
        my $l = 1;
        while (<I18N>)
        {
            chomp;
            my ($key, $value) = split(/=/, $_, 2);
            $settings{$key} = $value;
            $order{$l} = $key;
            $l++
        }
    }
}


So it reads the file and not the db to set variables? Do we still template-custom this or just edit the i18n file?
At least my inbox has stopped filling!!
« Last Edit: August 21, 2011, 10:40:00 AM by compsos »
Regards

Gordon............