Debian Squeeze vzquota

Debian Squeeze vzquota

显然,我让 Debian Squeeze(Debian 6)按照说明使用 debootstrap 和 chroot 在 VPS 上运行这里。
后续安装 harden、exim4、mysql-server 包部分失败。

相关信息:

insserv: warning: script 'S10vzquota' missing LSB tags and overrides
insserv: warning: script is corrupt or invalid: /etc/init.d/../rc6.d/S00vzreboot
insserv: warning: script 'vzquota' missing LSB tags and overrides
insserv: There is a loop between service vzquota and stop-bootlogd if started
insserv:  loop involving service stop-bootlogd at depth 2
insserv:  loop involving service vzquota at depth 1
insserv:  loop involving service rsyslog at depth 1
insserv: Starting vzquota depends on stop-bootlogd and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on stop-bootlogd and therefore on system facility `$all' which can not be true!
insserv: There is a loop between service vzquota and stop-bootlogd if started
insserv: Starting vzquota depends on stop-bootlogd and therefore on system facility `$all' which can not be true!
insserv: Starting vzquota depends on stop-bootlogd and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: error processing exim4-base (--configure):
 subprocess installed post-installation script returned error exit status 1

有什么建议么?

关键词:vzquota debian squeeze 安装 vps,虚拟专用服务器。

答案1

我检查vzquota后发现它不符合 Debian 6.0 标准(初始化脚本)——这很自然,因为提供商当时只支持 5.0。

在我修复之前:

#!/bin/sh
start() {
    [ -e "/dev/vzfs" ] || mknod /dev/vzfs b 0 115
    rm -f /etc/mtab >/dev/null 2>&1
    echo "/dev/vzfs / reiserfs rw,usrquota,grpquota 0 0" > /etc/mtab
    mnt=`grep -v " / " /proc/mounts`
    if [ $? == 0 ]; then
        echo "$mnt" >> /etc/mtab
    fi 
}
case "$1" in
  start)
        start
        ;;
  *)
    exit
esac 

我将以下部分添加到 /etc/init.d/vzquota(不要忘记删除第二行 shabang):

#!/bin/sh
### BEGIN INIT INFO
# Provides:                 vzquota
# Required-Start:
# Required-Stop:
# Should-Start:             $local_fs $syslog
# Should-Stop:              $local_fs $syslog
# Default-Start:            0 1 2 3 4 5 6
# Default-Stop:
# Short-Description:        Fixed(?) vzquota init script
### END INIT INFO

安装成功了。但在重新启动以验证我的更改后,我发现原始文件再次接管了。

也许其他人可以提出更持久的解决方案。

編輯0:当我最终决定提交错误报告时,我发现。因此,我建议的解决方法对于无法访问需要修复的文件的人来说很有用。

答案2

如果您无法修改创建该文件的 OpenVZ sh 脚本,您可以执行以下操作:

  • 1:cp /etc/init.d/vzquota /etc/init.d/vzquota.original(不需要,但备份总是有用的)

  • 2:只需使用 nano 或 vi 加上 benjamin 提供的补丁编辑 vzquota 文件,然后将修改后的文件复制到 /etc/init.d/vzquota.works

  • 3:创建文件 /etc/init.d/vzquotafix,内容如下:

    #!/bin/sh
    ### BEGIN INIT INFO
    # Provides:                 vzquotafix
    # Required-Start:
    # Required-Stop:
    # Should-Start:             $local_fs $syslog
    # Should-Stop:              $local_fs $syslog
    # Default-Start:            2 3 4 5
    # Default-Stop:             0 1 6
    # Short-Description:        Fix for vzquota init script
    ### END INIT INFO
    set -e
    cat /etc/init.d/vzquota.works > /etc/init.d/vzquota
    exit 0
    
  • 4:chmod 755 /etc/init.d/vzquotafix

  • 5:更新rc.d vzquotafix 默认值

每次重启时,该脚本都会替换 OpenVZ 创建的损坏的 vzquota 文件。

相关内容