我正在使用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