1

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

Floh
  • 33
  • 9
  • Just an input, I tested that command using rundeck 3.2.8 against Debian 9 and Ubuntu 20.04, also, I added another debconf related command to check and it seems work normally. Job Definition: https://pastebin.com/FVxMQSgk and here the result: https://imgur.com/w3xj4P2 – MegaDrive68k Jul 01 '20 at 18:15
  • Thank you for checking and providing your job definition. Mine looks same: https://pastebin.com/YSu545tX – Floh Jul 02 '20 at 06:59

2 Answers2

1

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.

Ruli
  • 2,592
  • 12
  • 30
  • 40
Floh
  • 33
  • 9
0

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.

du yu
  • 1
  • 1