Rundeck debconf-set-selection:

我正在使用Rundeck 3.2.6-20200427,并设置了一个用于安装软件包的作业。

因为rundeck非交互式运行,所以我需要预先设置一些用于安装软件包的参数(在我的情况下是iptables-persistent)。

在安装软件包之前,我运行该命令(目前仅此参数,如果可以使用,我将使用更多参数):

echo iptables-persistent iptables-persistent/autosave_v4 boolean false | sudo debconf-set-selections

不幸的是,如果我运行rundeck-command,我会收到该错误

09:09:08    debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
09:09:08    Failed: NonZeroResultCode: Remote command failed with exit status 1

我绝对确定没有其他任务或与dpkg相关的进程。

~$ lsof /var/cache/debconf/config.dat
~$

如果我尝试直接运行该命令,它将正常工作而不会出现任何错误。所以我不明白,为什么它不能与rundeck一起使用。

我在新安装的主机上尝试安装软件包(Ubuntu Server 20.04)。

这是我的工作定义:https://pastebin.com/YSu545tX

iCMS 回答:Rundeck debconf-set-selection:

我发现了。在节点文件中,有拼写错误,因此作业在错误的主机上运行,​​并且有一个apt进程被卡住了。

我在那里检查了该命令:

~$ sudo fuser -v /var/cache/debconf/config.dat
                     USER        PID ACCESS COMMAND
/var/cache/debconf/config.dat:
                     root       5563 F.... frontend

然后我杀死了该进程并更正了节点文件。现在可以了。

对不起! :/

本文链接:https://www.f2er.com/2022881.html

大家都在问