+ Responder ao Tópico



  1. #1
    Saudações!

    Instalei e configurei um servidor de e-mail com sendmail+mailscanner+sophos. O único problema que encontrei foi na atulização do sophos. Junto com o mailscanner, veio um arquivo de atulização automática que não está funcionando. Quando eu executo o mesmo o sistema diz que não foi possível determinar a versão do sophos, o sistema também mostra erro na linha 94(warn "@_, $!"<IMG SRC="images/forum/icons/icon_wink.gif">.
    Alguem pode me ajudar?

    O sophos está instaldo em /usr/local/Sophos;
    O diretorio que tem os arquivos de .dat é /usr/local/Sophos/ide

    O arquivo:


    #!/usr/bin/perl

    use Sys::Syslog;

    $SophosRoot = "/usr/local/Sophos";
    $IDELink = "$SophosRoot/ide";
    $VDLDir = "IDELink";

    #$Lynx = "/usr/local/bin/lynx -dump";
    $Lynx = "/usr/bin/wget -q -O-"; # On Linux use this
    $Unzip = "/usr/bin/unzip -joqq";
    $rm = "/bin/rm";
    $LockFile = "/tmp/SophosBusy.lock";

    $LOCK_SH = 1;
    $LOCK_EX = 2;
    $LOCK_NB = 4;
    $LOCK_UN = 8;

    Sys::Syslog:<IMG SRC="images/forum/icons/icon_eek.gif">penlog("Sophos-autoupdate", &acute;pid, nowait&acute;, &acute;mail&acute;

    # Work out the current VDL (and hence Sophos Sweep) version number
    #chdir "$SophosRoot/bin/$VDLDir";
    chdir "IDELink";
    opendir(LIBDIR, ".&quot<IMG SRC="images/forum/icons/icon_wink.gif"> || &BailOut("Cannot open Sophos/lib directory&quot<IMG SRC="images/forum/icons/icon_wink.gif">;
    foreach $vdlname (sort readdir(LIBDIR)) {
    next unless $vdlname =~ /^vdl-(\d+)\.(\d+)([a-z]?)\.dat$/;
    $MajorVer = $1;
    $MinorVer = $2;
    $NSVFlag = $3;
    }
    closedir(LIBDIR);
    &BailOut("Could not calculate Sophos version number&quot<IMG SRC="images/forum/icons/icon_wink.gif">
    unless defined($MajorVer) && defined($MinorVer);
    $SophosVersion = "$MajorVer$MinorVer";
    $VDLVersion = "$MajorVer.$MinorVer";

    # Derive other variables, filenames and URLs from the version numbers
    $ZipName = $SophosVersion. "_ides.zip";
    $URL = "http://www.sophos.com/downloads/ide/$ZipName";

    ($min,$hour,$date,$month,$year) = (localtime)[1,2,3,4,5];
    $month++;
    $year+=1900;
    $IDEDir = "$SophosRoot/ide." . sprintf("%04d%02d%02d%02d%02d", $year, $month, $date, $hour, $min);

    # If the directory already exists, then we have already done the update
    # for today, so quietly exit.
    Sys::Syslog::syslog(&acute;info&acute;, "Sophos already up-to-date&quot<IMG SRC="images/forum/icons/icon_wink.gif">,exit 0 if -d $IDEDir;

    # Create the IDE files directory
    umask 0022;
    mkdir $IDEDir, 0755;
    chdir $IDEDir or &BailOut("Cannot cd $IDEDir, $!&quot<IMG SRC="images/forum/icons/icon_wink.gif">;

    # Fetch and unpack the IDE zip file from Sophos
    #print STDERR "URL is $URL\n";
    $result = system("$Lynx $URL > $ZipName&quot<IMG SRC="images/forum/icons/icon_wink.gif">;
    if (($result>><IMG SRC="images/forum/icons/icon_cool.gif">==1) {
    Sys::Syslog::syslog(&acute;err&acute;, "Your Sophos installation may be too old. Please install the latest release of Sophos&quot<IMG SRC="images/forum/icons/icon_wink.gif">;
    print STDERR "Your Sophos installation may be too old. Please install the latest release of Sophos";
    }
    &BailOut("Lynx failed with error return " . ($result>><IMG SRC="images/forum/icons/icon_cool.gif"> . "\n&quot<IMG SRC="images/forum/icons/icon_wink.gif"> if $result>>8;

    $result = system("$Unzip $ZipName&quot<IMG SRC="images/forum/icons/icon_wink.gif">;
    if ($result>><IMG SRC="images/forum/icons/icon_cool.gif"> {
    Sys::Syslog::syslog(&acute;err&acute;, "Unzipping the new Sophos IDE files failed. This may well be because your Sophos installation is too old. Please install the latest release of Sophos&quot<IMG SRC="images/forum/icons/icon_wink.gif">;
    print STDERR "Unzipping the new Sophos IDE files failed. This may well be because your Sophos installation is too old. Please install the latest release of Sophos";
    &BailOut("Unzip failed with error return " . ($result>><IMG SRC="images/forum/icons/icon_cool.gif"> . "\n&quot<IMG SRC="images/forum/icons/icon_wink.gif">;
    }

    symlink("$VDLDir/vdl-$VDLVersion$NSVFlag.dat", "vdl.dat&quot<IMG SRC="images/forum/icons/icon_wink.gif">;

    # Add the new vdl*.vdb files if they are there
    foreach $number (1..99) {
    $string = "vdl" . sprintf("%02d", $number) . ".vdb";
    symlink("$VDLDir/$string", $string) if -f "$VDLDir/$string";
    }

    # Link in this new directory to Sophos
    chdir $SophosRoot or &BailOut("Cannot cd $SophosRoot, $!&quot<IMG SRC="images/forum/icons/icon_wink.gif">;
    $OldLinkTarget = readlink $IDELink;
    &LockSophos();
    unlink $IDELink if -l $IDELink;
    symlink $IDEDir, $IDELink;
    &UnlockSophos();
    system("$rm -rf $OldLinkTarget&quot<IMG SRC="images/forum/icons/icon_wink.gif"> if defined $OldLinkTarget && -e $OldLinkTarget;
    Sys::Syslog::syslog(&acute;info&acute;, "Sophos successfully updated in $IDEDir&quot<IMG SRC="images/forum/icons/icon_wink.gif">;
    Sys::Syslog::closelog();
    exit 0;

    sub BailOut {
    Sys::Syslog::syslog(&acute;err&acute;, @_);
    Sys::Syslog::closelog();
    warn "@_, $!";
    chdir $SophosRoot or die "Cannot cd $SophosRoot, $!";
    system("$rm -rf $IDEDir&quot<IMG SRC="images/forum/icons/icon_wink.gif"> if -d $IDEDir;
    exit 1;
    }

    sub LockSophos {
    open(LOCK, ">$LockFile&quot<IMG SRC="images/forum/icons/icon_wink.gif"> or return;
    flock(LOCK, $LOCK_EX);
    print LOCK "Locked for updating Sophos IDE files by $$\n";
    }

    sub UnlockSophos {
    print LOCK "Unlocked after updating Sophos IDE files by $$\n";
    unlink $LockFile;
    flock(LOCK, $LOCK_UN);
    close LOCK;
    }

  2. #2
    glasswalk3r
    esse monte de carinhas não ajuda muito...

    esse erro é do script perl, mas com esse monte de smileys eu não entendi nada...



  3. #3
    Diz teu e-mail que eu mando pra você...






Tópicos Similares

  1. Fedora nao atualiza
    Por rodrigojoi no fórum Sistemas Operacionais
    Respostas: 1
    Último Post: 06-11-2005, 16:06
  2. Ad-ware não atualiza qdo passa pelo proxy
    Por buribai no fórum Servidores de Rede
    Respostas: 1
    Último Post: 25-05-2005, 07:15
  3. meu radwho nao atualiza
    Por ederamboni no fórum Servidores de Rede
    Respostas: 0
    Último Post: 17-01-2005, 10:12
  4. LiveUpdate não atualiza com o proxy
    Por cristianff no fórum Servidores de Rede
    Respostas: 1
    Último Post: 03-03-2004, 13:08
  5. Respostas: 0
    Último Post: 31-07-2003, 13:22

Visite: BR-Linux ·  VivaOLinux ·  Dicas-L