从 Debian 10 更新到 Debian 11 出错

从 Debian 10 更新到 Debian 11 出错

我刚刚使用从 Debian 10 升级到 Debian 11这些说明一切似乎都进展顺利,只有 maldet 出现故障。

这是错误:

maldet[2117]: maldet(2117): {mon} kernel does not support inotify(), aborting
systemd[1]: maldet.service: Can't open PID file /usr/local/maldetect/tmp/inotifywait.pid (yet?) after start: Operation not permitted 
systemd[1]: maldet.service: Failed with result 'protocol'.
systemd[1]: Failed to start Linux Malware Detect monitoring - maldet.

我的 /usr/lib/systemd/system/maldet.service 文件包含:

[Unit]
Description=Linux Malware Detect monitoring - maldet
After=network.target

[Service]
EnvironmentFile=/usr/local/maldetect/conf.maldet
ExecStart=/usr/local/maldetect/maldet --monitor USERS
ExecStop=/usr/local/maldetect/maldet --kill-monitor
Type=forking
PIDFile=/usr/local/maldetect/tmp/inotifywait.pid
[Install]
WantedBy=multi-user.target

在更新之前,我确认所有服务都正常运行,并且在更新过程中选择“N”否,拒绝替换我的自定义配置文件......所以什么都不应该改变。

另外,我正在使用 Linux 5.10.0-8-amd64 和 maldet 1.6.4

有人能帮我解决这个问题吗?谢谢

答案1

问题在于文件中的条件/usr/local/maldetect/internals/functions

if [ -f "/boot/System.map-$(uname -r)" ]; then
        ksup=`grep -i inotify_ /boot/System.map-$(uname -r)`
        if [ -z "$ksup" ]; then
            eout "{mon} kernel does not support inotify(), aborting." 1
            exit
        fi
    elif [ -f "/boot/config-$(uname -r)" ]; then
        ksup=`grep -m1 CONFIG_INOTIFY /boot/config-$(uname -r)`
        if [ -z "$ksup" ]; then
            eout "{mon} kernel does not support inotify(), aborting." 1
            exit
        fi
fi

它在文件上执行 grep/boot/System.map-$(uname -r)但在 Debian 11 中内容是ffffffffffffffff B The real System.map is in the linux-image-<version>-dbg package

我看到两个快速解决方案,第一个是检查正确的文件:

  • 使用此命令为正在运行的内核安装 dbg 包apt install linux-image-$(uname -r)-dbg
  • 将条件的文件路径替换为指向正确的文件路径sed -i 's#/boot/System.map#/lib/debug/boot/System.map#' /usr/local/maldetect/internals/functions

为了避免安装 dbg 包,另一个解决方案是删除第一个条件,仅使用第二个条件(检查)/boot/config-$(uname -r)

我使用第一个进行测试,Maldetect 现已启动。两种解决方案都应该可以工作,等待最终修复。

问候

相关内容