Rundeck debconf-set-selection:

261 views Asked by At

I'm using Rundeck 3.2.6-20200427 and set up a job for installing packages.

Because rundeck runs noninteractive I need to preset some parameters for installing packages (in my case iptables-persistent).

Before installing the package I run that command (for now only this parameter, I will use more parameters if I got that working):

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

Unfortunatelly I got that error if I run 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

I'm absolute sure that there are no other task or running dpkg related process.

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

If I try to run that command directly, it works without any error. So I don't understand, why it is not working with rundeck.

I tried that on freshly installed host where I try to install packages (Ubuntu Server 20.04).

Here is my job definition: https://pastebin.com/YSu545tX

2

There are 2 answers

0
Floh On

I found out that in the node-file, there was a typo so the job was running on wrong host and there were an apt-process, which was stuck.

There I checked with that command:

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

Then I killed that process and corrected the node-file. Now it works.

0
du yu On

I meet the same problem, but both 'fuser' and 'lsof' show nothing. finally finds out is dpkg lock that file, and use

ps aux | grep dpkg

to find that process and kill it.