BackupPC-users

Re: [BackupPC-users] Solution for Re: no cpool info shown on web interface

2008-04-14 09:33:42
Subject: Re: [BackupPC-users] Solution for Re: no cpool info shown on web interface
From: Craig Barratt <cbarratt AT users.sourceforge DOT net>
To: Tino Schwarze <backuppc.lists AT tisc DOT de>
Date: Mon, 14 Apr 2008 06:33:19 -0700
Tino writes:

> I found a problem. IO::Dirent returns 0 as the type for the directories,
> so BackupPC::Lib->find() doesn't descent into them. Why it does so if
> run manually - I don't know.
> 
> It does return a type 4 on ext3, on xfs it's always 0.

Good detective work.

There is a check in BackupPC::Lib that should catch this.
I'm not sure why that check passes in this case.  Here's
the code:

    BEGIN {
        eval "use IO::Dirent qw( readdirent DT_DIR );";
        if ( !$@ && opendir(my $fh, ".") ) {
            #
            # Make sure the IO::Dirent really works - some installs
            # on certain file systems don't return a valid type.
            #
            my $dt_dir = eval("DT_DIR");
            foreach my $e ( readdirent($fh) ) {
                if ( $e->{name} eq "." && $e->{type} == $dt_dir ) {
                    $IODirentOk = 1;
                    last;
                }
            }
            closedir($fh);
        }
    };

Ah, I bet "." (where BackupPC is running) is on an ext3 file system,
where is should be checking $TopDir.

Unfortunately this test is done before the config file has been read.
I would guess that if you replace this line:

        if ( !$@ && opendir(my $fh, ".") ) {

with your hardcoded TopDir, eg:

        if ( !$@ && opendir(my $fh, "/data/BackupPC") ) {

then the correct thing should happen (IO::Dirent should be disabled).

If you can confirm that, then the fix is I should delay the check on
IO::Dirent until after TopDir is known.

Craig

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/