backupc 错误:子进程过早退出

发布于 2024-10-10 14:09:34 字数 1361 浏览 5 评论 0原文

突然,一台服务器无法备份。我收到一条奇怪的错误消息:

2011-01-04 10:10:37 host1: Can't fork at /usr/share/backuppc/lib/BackupPC/Lib.pm line 1128.

这个错误是什么意思?

所有其他主机(具有相同操作系统)都没有此问题。

预先感谢您的回复。 :)


    $cmd = [split(/\s+/, $cmd)] if ( ref($cmd) ne "ARRAY" );
    print(STDERR "cmdSystemOrEval: about to system ",
          $bpc->execCmd2ShellCmd(@$cmd), "\n")
                    if ( $bpc->{verbose} );
    if ( !defined($pid = open(CHILD, "-|")) ) {  #  <<<<<<<<<  1128
        my $err = "Can't fork to run @$cmd\n";
        $? = 1;
        $$stdoutCB .= $err if ( ref($stdoutCB) eq 'SCALAR' );
        &$stdoutCB($err)   if ( ref($stdoutCB) eq 'CODE' );
        return $err        if ( !defined($stdoutCB) );
        return;
    }
    binmode(CHILD);
    if ( !$pid ) {
        #
        # This is the child
        #
        close(STDERR);
        if ( $ignoreStderr ) {
            open(STDERR, ">", "/dev/null");
        } else {
            open(STDERR, ">&STDOUT");
        }
        alarm(0);
        $cmd = [map { m/(.*)/ } @$cmd];             # untaint
        #
        # force list-form of exec(), ie: no shell even for 1 arg
        #
        exec { $cmd->[0] } @$cmd;
        print(STDERR "Exec of @$cmd failed\n");
        exit(1);
    }

Suddenly, one server cannot be backed up. i get a strange error message:

2011-01-04 10:10:37 host1: Can't fork at /usr/share/backuppc/lib/BackupPC/Lib.pm line 1128.

What does this error mean?

All other hosts (with same OS) don't have this problem.

Thanks in advance for any reply. :)


    $cmd = [split(/\s+/, $cmd)] if ( ref($cmd) ne "ARRAY" );
    print(STDERR "cmdSystemOrEval: about to system ",
          $bpc->execCmd2ShellCmd(@$cmd), "\n")
                    if ( $bpc->{verbose} );
    if ( !defined($pid = open(CHILD, "-|")) ) {  #  <<<<<<<<<  1128
        my $err = "Can't fork to run @$cmd\n";
        $? = 1;
        $stdoutCB .= $err if ( ref($stdoutCB) eq 'SCALAR' );
        &$stdoutCB($err)   if ( ref($stdoutCB) eq 'CODE' );
        return $err        if ( !defined($stdoutCB) );
        return;
    }
    binmode(CHILD);
    if ( !$pid ) {
        #
        # This is the child
        #
        close(STDERR);
        if ( $ignoreStderr ) {
            open(STDERR, ">", "/dev/null");
        } else {
            open(STDERR, ">&STDOUT");
        }
        alarm(0);
        $cmd = [map { m/(.*)/ } @$cmd];             # untaint
        #
        # force list-form of exec(), ie: no shell even for 1 arg
        #
        exec { $cmd->[0] } @$cmd;
        print(STDERR "Exec of @$cmd failed\n");
        exit(1);
    }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雨巷深深 2024-10-17 14:09:34

由于某种原因,顶部给出的错误消息与代码中给出的错误消息不匹配。

错误消息缺少报告 $ERRNO。请参阅 fork(2) 了解此系统调用的失败模式。

改进错误报告,那么您就无需猜测原因。

The error message given at the top does not match the error message given in the code for some reason.

The error message lacks reporting $ERRNO. See fork(2) for the modes of failure for this system call.

Improve error reporting, then you need not guess about the cause.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文