PDA

View Full Version : smt-mirror "Cannot read the local base path"



markcasey
05-Jun-2015, 04:52
Hi
I have some problems with my Apache system and now my SMT is not mirroring.

When I run smt-mirror I get the above error

my SMT.conf has the entry
MirrorTo = /srv/www/vhosts/sles.pegasustech.com.au/smt

I made a backup copy of smt-mirror and changed the relevant section as follows

if(!defined $LocalBasePath || $LocalBasePath eq "" )
{
$LocalBasePath = $cfg->val("LOCAL", "MirrorTo");
print "\n >$LocalBasePath< \n";
if(!-d $LocalBasePath)
{
SMT::Utils::printLog($LOG, $vblevel, LOG_ERROR, __("Cannot read the local base path >$LocalBasePath<"));
SMT::Utils::unLockAndExit( "smt-mirror", 1, $LOG, $vblevel );
}
}

When I run the altered file i get

>/srv/www/vhosts/sles.pegasustech.com.au/smt<
Cannot read the local base path >/srv/www/vhosts/sles.pegasustech.com.au/smt<

So I created a test program
#!/usr/bin/perl -w
#
use strict;
my $aaa="/srv/www/vhosts/sles.pegasustech.com.au/smt";

print ">$aaa< \n";

if ( !-d $aaa) {
print "NotFound \n";
}
else {
print "Found \n";
}

Running the Test Program returns:

>/srv/www/vhosts/sles.pegasustech.com.au/smt<
Found

Oh, the directory does exist owner smt:www

Why is the result different between these two ??

Thanks in advance

Mark

jmozdzen
05-Jun-2015, 15:54
Hi Mark,

I couldn't spot any functional difference between the two programs, so I have only left a shot into the dark: what does "ls -ld /srv/www/vhosts/sles.pegasustech.com.au/smt; df /srv/www/vhosts/sles.pegasustech.com.au/smt" give and as which user(s) are you running smt-mirror / your test program?

You did mention the directory ownership, but neither the actual permissions that are set nor if the directory is i.e. mounted via NFS (and the target server has root_squash activated), hence above commands.

Regards,
Jens

markcasey
07-Jun-2015, 02:18
Hi Mark,

I couldn't spot any functional difference between the two programs, so I have only left a shot into the dark: what does "ls -ld /srv/www/vhosts/sles.pegasustech.com.au/smt; df /srv/www/vhosts/sles.pegasustech.com.au/smt" give and as which user(s) are you running smt-mirror / your test program?

You did mention the directory ownership, but neither the actual permissions that are set nor if the directory is i.e. mounted via NFS (and the target server has root_squash activated), hence above commands.

Regards,
Jens

Hi Jens

Thanks for the help

Yes it is an NFS mount, so I ran the commands against the unmounted diretcory and the mounted one - Same result
As its only checking for the existance of smt, the directory, it should work in the unmounted state.

See unmounted test and mounted test below

Mark

umount /srv/www/vhosts/sles.pegasustech.com.au/smt
pegasus-apache-01:/srv/www/vhosts/sles.pegasustech.com.au # df /srv/www/vhosts/sles.pegasustech.com.au/smt
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdb1 20125340 1156296 17946736 7% /srv/www
pegasus-apache-01:/srv/www/vhosts/sles.pegasustech.com.au # ls -ld /srv/www/vhosts/sles.pegasustech.com.au/smt
drwxr-xr-x 3 wwwrun www 4096 May 25 14:16 /srv/www/vhosts/sles.pegasustech.com.au/smt
pegasus-apache-01:/srv/www/vhosts/sles.pegasustech.com.au # smt-mirror1

>/srv/www/vhosts/sles.pegasustech.com.au/smt<
Cannot read the local base path >/srv/www/vhosts/sles.pegasustech.com.au/smt<


pegasus-apache-01:/srv/www/vhosts/sles.pegasustech.com.au # mount -a
pegasus-apache-01:/srv/www/vhosts/sles.pegasustech.com.au # df /srv/www/vhosts/sles.pegasustech.com.au/smt
Filesystem 1K-blocks Used Available Use% Mounted on
10.242.200.248:/vol/slesSMT 838860800 410776256 428084544 49% /srv/www/vhosts/sles.pegasustech.com.au/smt
pegasus-apache-01:/srv/www/vhosts/sles.pegasustech.com.au # ls -ld

markcasey
07-Jun-2015, 02:56
Hi Jens

Got it
I put
system("/usr/bin/id");
system("/bin/ls -l $LocalBasePath");
in my test program and fount it returned smt and www as the executing user and group, and failed on the ls

The parent diretcory had ownership of wwwrun and www, but only user access rights. adding access to the parent directory for group solved the problem

Thanks for your help

Mark

jmozdzen
09-Jun-2015, 14:02
Hi Mark,

good to hear you got it working, and thank you for reporting how!

Regards,
Jens