Koozali.org: home of the SME Server

Squid Problem

Gaetan

Squid Problem
« on: June 23, 2003, 12:39:15 AM »
Hi,

A few days ago, the hard drive of my e-smith server went full.After clearing it, when rebooting the server, I started to get funny message when loading the SQUID service.
Now, from the prompt (root), when I try to run "squid -k shutdown", I get the following message (below).
Can someone explain the problem ?
How can I sort it out ?

Cheers

Gaetan

[root@e-smith /root]# squid -k shutdown
2003/06/22 20:34:20| parseConfigFile: line 19 unrecognized: 'Program fragment at
 line 1 delivered error Can't locate esmith/DB/db.pm in @INC (@INC contains: /
usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6
.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .)'''
2003/06/22 20:34:20| parseConfigFile: line 41 unrecognized: 'Program fragment at
 line 1 delivered error Can't locate esmith/DB/db.pm in @INC (@INC contains: /
usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6
.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .)'''
2003/06/22 20:34:20| parseConfigFile: line 43 unrecognized: '2003/06/22 20:34:20| parseConfigFile: line 113 unrecognized: '$strThisFileName =
 "index.php";'
2003/06/22 20:34:20| parseConfigFile: line 114 unrecognized: '$strThisDirectoryP
ath = $REQUEST_URI;'
2003/06/22 20:34:20| parseConfigFile: line 116 unrecognized: '$strThisServerName
 = $SERVER_NAME;'
2003/06/22 20:34:20| parseConfigFile: line 118 unrecognized: '$strThisPageFilesD
ir = "/images/indexerfiles/";'
2003/06/22 20:34:20| parseConfigFile: line 120 unrecognized: '$strThisPageCssFil
e= $strThisPageFilesDir ."dirindexer.css";'
2003/06/22 20:34:20| parseConfigFile: line 122 unrecognized: '$arrFileImgProps =
 array('filepath' => $strThisPageFilesDir ."file.gif", 'height' => '13', 'width'
 => '13');'
2003/06/22 20:34:20| parseConfigFile: line 123 unrecognized: '$arrDirImageProps
= array('filepath' => $strThisPageFilesDir ."dir.gif", 'height' => '13', 'width'
 => '13');'
2003/06/22 20:34:20| parseConfigFile: line 124 unrecognized: '$arrBulletImgs = a
rray('fileImg' => $arrFileImgProps, 'dirImg' => $arrDirImageProps);'
2003/06/22 20:34:20| parseConfigFile: line 136 unrecognized: '$arrDontListFiles
= array($strThisFileName, $arrBulletImgs['dirImg']['filepath'], $arrBulletImgs['
fileImg']['filepath'], $strThisPageCssFile);'
2003/06/22 20:34:20| parseConfigFile: line 137 unrecognized: '$arrDontListDirs =
 array($strThisPageFilesDir , "cgi-bin", "indexerfiles");'
2003/06/22 20:34:20| parseConfigFile: line 191 unrecognized: '$arrDontListFilesE
xts = array();'
2003/06/22 20:34:20| parseConfigFile: line 192 unrecognized: '$arrListOnlyFilesE
xts = array();'
2003/06/22 20:34:20| parseConfigFile: line 199 unrecognized: '$intShowSubdirs =
1;'
2003/06/22 20:34:20| parseConfigFile: line 204 unrecognized: 'function getThisDi
rName($strUrl)'
2003/06/22 20:34:20| parseConfigFile: line 205 unrecognized: 'Program fragment a
t line 163 delivered error Undefined subroutine &esmith::__TEMPLATE__::1::strr
pos called'''
2003/06/22 20:34:20| parseConfigFile: line 212 unrecognized: 'function isort($st
rA,$strB)'
2003/06/22 20:34:20| parseConfigFile: line 213 unrecognized: 'Program fragment a
t line 180 delivered error syntax error'''
2003/06/22 20:34:20| parseConfigFile: line 215 unrecognized: 'function isortMult
iD($strA,$strB)'
2003/06/22 20:34:20| parseConfigFile: line 216 unrecognized: 'Program fragment a
t line 200 delivered error syntax error'''
2003/06/22 20:34:20| parseConfigFile: line 218 unrecognized: 'function indexdirT
hisDir()'
2003/06/22 20:34:20| parseConfigFile: line 219 unrecognized: 'Program fragment a
t line 217 delivered error Not enough arguments for opendir'''
2003/06/22 20:34:20| parseConfigFile: line 221 unrecognized: '$thisDirName = get
ThisDirName($strThisDirectoryPath);'
2003/06/22 20:34:20| parseConfigFile: line 222 unrecognized: '$strListingHTMLstr
ing = indexdirThisDir();'
2003/06/22 20:34:20| parseConfigFile: line 224 unrecognized: 'header("Content-ty
pe: text/html");'
2003/06/22 20:34:20| parseConfigFile: line 226 unrecognized: 'print (''
2003/06/22 20:34:20| parseConfigFile: line 227 unrecognized: 'LIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-s
trict.dtd">'
2003/06/22 20:34:20| parseConfigFile: line 228 unrecognized: ''
2003/06/22 20:34:20| parseConfigFile: line 229 unrecognized: ''
2003/06/22 20:34:20| parseConfigFile: line 230 unrecognized: ''
2003/06/22 20:34:20| parseConfigFile: line 231 unrecognized: 'index of '.<br />$thisDirName.''
2003/06/22 20:34:20| parseConfigFile: line 232 unrecognized: ''
2003/06/22 20:34:20| parseConfigFile: line 233 unrecognized: ''
2003/06/22 20:34:20| parseConfigFile: line 235 unrecognized: '
'
2003/06/22 20:34:20| parseConfigFile: line 236 unrecognized: '

Tech-Geeks.Org
:Contrib Area

'
2003/06/22 20:34:20| parseConfigFile: line 237 unrecognized: '

'.$thisDirName
.'

'
2003/06/22 20:34:20| parseConfigFile: line 238 unrecognized: 'Up O
ne Level

'
2003/06/22 20:34:20| parseConfigFile: line 239 unrecognized: ''.$strListingHTMLs
tring.''
2003/06/22 20:34:20| parseConfigFile: line 241 unrecognized: '
'
2003/06/22 20:34:20| parseConfigFile: line 242 unrecognized: 'lophty directory i
ndexer'
2003/06/22 20:34:20| parseConfigFile: line 243 unrecognized: 'copyright © 2
001 - 2002 brian donovan'
2003/06/22 20:34:20| parseConfigFile: line 244 unrecognized: '
'
2003/06/22 20:34:20| parseConfigFile: line 245 unrecognized: 'Modified by:Abe Lo
veless - '
2003/06/22 20:34:20| parseConfigFile: line 246 unrecognized: 'abe@lovelesscentral.org - '
2003/06/22 20:34:20| parseConfigFile: line 247 unrecognized: 'February 23, 2002<
br>'
2003/06/22 20:34:20| parseConfigFile: line 249 unrecognized: 'validate me'
2003/06/22 20:34:20| parseConfigFile: line 251 unrecognized: '
'
2003/06/22 20:34:20| parseConfigFile: line 253 unrecognized: ''
2003/06/22 20:34:20| parseConfigFile: line 254 unrecognized: '');'
2003/06/22 20:34:20| parseConfigFile: line 255 unrecognized: '?>'

Abe Loveless

Re: Squid Problem
« Reply #1 on: June 25, 2003, 03:38:30 AM »
You've got an "index.php" file in one of the following places:

/etc/e-smith/templates/etc/squid/squid.conf
/etc/e-smith/templates-custom/etc/squid/squid.conf

You need to track it down, and delete it.  Then expand the squid template (/sbin/e-smith/expand-template /etc/squid/squid.conf) and restart squid (service squid restart)

Gaetan

Re: Squid Problem
« Reply #2 on: June 25, 2003, 03:36:03 PM »
Hi,

Thanks for your reply.
I have found a index.php file in the '/etc/e-smith/templates-custom/etc/squid/squid.conf' directory.

I then run '/sbin/e-smith/expand-template /etc/squid/squid'
Then, run  'service squid stop' and get the following message:


[root@e-smith templates-custom]# service squid stop
Stopping squid: 2003/06/25 11:33:07| parseConfigFile: line 19 unrecognized: 'Program fragment at line 1 delivered error Can't locate esmith/DB/db.pm in @INC (@INC contains: /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .)'''
2003/06/25 11:33:07| parseConfigFile: line 41 unrecognized: 'Program fragment at line 1 delivered error Can't locate esmith/DB/db.pm in @INC (@INC contains: /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .)'''
.............                                              [   OK   ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I then type 'service squid start', I get the following:

Starting squid:                                            [   OK   ]



Question: What's wrong when the service is being stopped ?

Cheers

Gaetan

Abe Loveless

Re: Squid Problem
« Reply #3 on: June 25, 2003, 06:30:52 PM »
Did you delete the index.php file??

"rm /etc/e-smith/templates-custom/etc/squid/squid.conf/index.php"

Then expand the template and restart squid.

I'm guessing that it failed on stop, because it never got started correctly... due to the errors.

Let me know.

Gaetan

Re: Squid Problem
« Reply #4 on: June 25, 2003, 07:28:11 PM »
Hi,

Yes I did: "rm /etc/e-smith/templates-custom/etc/squid/squid.conf/index.php"

I have tried to run again "service squid stop". The service gets stopped but I still get funny message before it:


[root@e-smith squid.conf]# service squid stop
Stopping squid: 2003/06/25 15:15:16| parseConfigFile: line 19 unrecognized: 'Pro
gram fragment at line 1 delivered error Can't locate esmith/DB/db.pm in @INC (
@INC contains: /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/per
l5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site
_perl .)'''
2003/06/25 15:15:16| parseConfigFile: line 41 unrecognized: 'Program fragment at
 line 1 delivered error Can't locate esmith/DB/db.pm in @INC (@INC contains: /
usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6
.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .)'''
................                                           [   OK   ]


Then, Squid will restart well with "service squid start" ...

But if I decide to stop it again, the funny messages comes back again ....

Cheers

Gaetan

Abe Loveless

Re: Squid Problem
« Reply #5 on: June 25, 2003, 07:46:54 PM »
Sounds like there is something weird in your squid.conf file.

Could you send me the contents of your squid.conf file?

"mail MY-EMAIL < /etc/squid/squid.conf"

OR, post it here in a reply.

Thanks,

Charlie Brady

Re: Squid Problem
« Reply #6 on: June 25, 2003, 09:05:36 PM »
Gaetan wrote:

> [root@e-smith squid.conf]# service squid stop
> Stopping squid: 2003/06/25 15:15:16| parseConfigFile: line 19
> unrecognized: 'Pro
> gram fragment at line 1 delivered error Can't locate
> esmith/DB/db.pm in @INC (
> @INC contains: /usr/lib/perl5/5.6.0/i386-linux
> /usr/lib/perl5/5.6.0 /usr/lib/per
> l5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0
> /usr/lib/perl5/site
> _perl .)'''

You're running an old version. Upgrade.

Charlie

Abe Loveless

Re: Squid Problem
« Reply #7 on: June 25, 2003, 09:25:45 PM »
Got your message, but the message I sent back was rejected... so I'll post it here.



Yep... that's the problem.  Those lines must have been added at some point when you expanded the template.  Those calls to perl should not end up inside the squid.conf file.  I'd go back through the templates-custom/etc/squid/squid.conf directory to make sure the files template fragments look right.

Then expand the template again "/sbin/e-smith/expand-template /etc/squid/squid.conf" and check the squid.conf file to see if those lines are still there.

Let me know,
Abe

Gaetan

Re: Squid Problem
« Reply #8 on: June 27, 2003, 04:20:46 PM »
Hi,

I have check the ....
There are 2 files in there.
Here are the details:
FILE = 20ACL40no-cache


{
    my @NoCache = ();
    my $result = "";
    my $count = 0;

    use esmith::DB::db;
    my $db = esmith::DB::db->open('/home/e-smith/squidproperties');

    if ($db)
    {
        my @domains = $db->get_all_by_prop('type' => 'Domain');

        foreach my $d (@domains)
        {
            my $domain = $d->key;
            push @NoCache, $domain;
            $count++;
        }
    }


    if ($count > 0)
    {
        $result .= "\n";
        $result .= "#-----------------------------------\n";
        $result .= "# Force Direct Connection for Domains \n";
        $result .= "# ACL Statements \n";
        $result .= "#-----------------------------------\n";

        foreach my $NoCache (@NoCache)
        {
                $result .= "acl all_direct dstdomain $NoCache \n";
        }

        $result .= "\n";
    }

}




FILE = 80always_direct60no-cache

   UW PICO(tm) 4.0        File: 80always_direct60no-cache

{
    my $result = "";
    my @NoCache = ();
    my $count = 0;

    use esmith::DB::db;
    my $db = esmith::DB::db->open('/home/e-smith/squidproperties');

    if ($db)
    {
        my @domains = $db->get_all_by_prop('type' => 'Domain');

        foreach my $d (@domains)
        {
            my $domain = $d->key;
            push @NoCache, $domain;
            $count++;
        }
    }


    if ($count > 0)
    {
        $result .= "\n";
        $result .= "#-----------------------------------\n";
        $result .= "# Force Direct Connection for Domains \n";
        $result .= "# Always Direct Statements \n";
        $result .= "#-----------------------------------\n";
        $result .= "always_direct allow all_direct \n";
        $result .= "\n";
    }

}




I have re-run the expand-template bit, and the squid.conf file is wrong again !
I think that the problem comes from the above files ...

Check :
use esmith::DB::db;
my $db = esmith::DB::db->open('/home/e-smith/squidproperties');


What can I do ? I would like to qvoid having to upgrade E-Smith ? Just from now anyway.


Cheers

Gaetan

Abe Loveless

Re: Squid Problem
« Reply #9 on: June 27, 2003, 06:31:51 PM »
Should have asked this earlier, I suppose.  And, of course, Charlie eluded to it.  What version of SME are you using??

Gaetan

Re: Squid Problem
« Reply #10 on: June 27, 2003, 06:57:19 PM »
Version 5.1.2

Gaetan

Abe Loveless

Re: Squid Problem
« Reply #11 on: June 27, 2003, 07:21:15 PM »
Do you have domains entered that should not be cached (in the server-manager)?

If so, remove them.  You need to have 5.5 or greater for both pieces of the add-on to work correctly.

You might try removing the squidProperties app completely and restarting the system.


rm /etc/e-smith/web/functions/squidproperties
rm /etc/e-smith/web/panels/manager/cgi-bin/squidproperties
rm /etc/e-smith/templates-custom/etc/squid/squid.conf/80always_direct60no-cache
rm /etc/e-smith/templates-custom/etc/squid/squid.conf/20ACL40no-cache



http://tech-geeks.org/contrib/loveless/squidProperties/

Hope this helps