archlinuxhardened / selinux

PKGBUILDs to build SELinux enabled packages for Arch Linux
146 stars 25 forks source link

installation timed out, unable to lock database #11

Closed sorin-mihai closed 7 years ago

sorin-mihai commented 7 years ago

Hello,

I've seen this quite a few times, I figured it's not a big deal since the error appears after the packages are installed. I won't paste the whole output, some of it is in Romanian, but this is the end of it; please let me know if you need the whole output.

The problem looks like caused by a running pacman at the same time, but there is none, and that lock file shouldn't exist; obviously it's not there when I check. The system is running a full gnome session, but beside that, only terminal window is really active, where the build_and_install_all.sh script is ran, everything else is idle.

spawn pacman --color never -U ./linux-selinux/linux-selinux-4.12.5-1-x86_64.pkg.tar.xz ./linux-selinux/linux-selinux-docs-4.12.5-1-x86_64.pkg.tar.xz ./linux-selinux/linux-selinux-headers-4.12.5-1-x86_64.pkg.tar.xz
loading packages...
resolving dependencies...
looking for conflicting packages...

Package (3)            Old Version  New Version  Net Change

linux-selinux          4.12.4-1     4.12.5-1       0.00 MiB
linux-selinux-docs     4.12.4-1     4.12.5-1       0.00 MiB
linux-selinux-headers  4.12.4-1     4.12.5-1       0.00 MiB

Total Installed Size:  176.92 MiB
Net Upgrade Size:        0.00 MiB

:: Proceed with installation? [Y/n] y
(3/3) checking keys in keyring                                                                                       [######################################################################] 100%
(3/3) checking package integrity                                                                                     [######################################################################] 100%
(3/3) loading package files                                                                                          [######################################################################] 100%
(3/3) checking for file conflicts                                                                                    [######################################################################] 100%
:: Running pre-transaction hooks...
(1/2) etckeeper: pre-transaction commit
[master f622573] saving uncommitted changes in /etc prior to pacman run
 Author: ###hidden for the sake of my inbox###
 1 file changed, 2 insertions(+), 2 deletions(-)
(2/2) Remove DKMS modules
==> dkms remove sysdig/0.17.0 -k 4.12.4-1-selinux
==> dkms remove broadcom-wl/6.30.223.271 -k 4.12.4-1-selinux
:: Processing package changes...
(1/3) upgrading linux-selinux                                                                                        [######################################################################] 100%
warning: directory permissions differ on /boot/
filesystem: 700  package: 755
>>> Updating module dependencies. Please wait ...
(2/3) upgrading linux-selinux-docs                                                                                   [######################################################################] 100%
(3/3) upgrading linux-selinux-headers                                                                                [######################################################################] 100%
:: Running post-transaction hooks...
(1/5) Install DKMS modules
==> dkms install sysdig/0.17.0 -k 4.12.5-1-selinux
==> dkms install broadcom-wl/6.30.223.271 -k 4.12.5-1-selinux
(2/5) Updating linux-selinux initcpios
==> Building image from preset: /etc/mkinitcpio.d/linux-selinux.preset: 'default'
  -> -k /boot/vmlinuz-linux-selinux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-selinux.img
==> Starting build: 4.12.5-1-selinux
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [plymouth]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [consolefont]
  -> Running build hook: [keymap]
  -> Running build hook: [keyboard]
  -> Running build hook: [block]
  -> Running build hook: [plymouth-encrypt]
  -> Running build hook: [lvm2]
  -> Running build hook: [resume]
  -> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating xz-compressed initcpio image: /boot/initramfs-linux-selinux.img
==> Image generation successful
(3/5) Arming ConditionNeedsUpdate...
(4/5) etckeeper: post-transaction commit
(5/5) SELinux: relabel installed files
Relabeling package files...
Time out.
installation timed out, retrying (1)
spawn pacman --color never -U ./linux-selinux/linux-selinux-4.12.5-1-x86_64.pkg.tar.xz ./linux-selinux/linux-selinux-docs-4.12.5-1-x86_64.pkg.tar.xz ./linux-selinux/linux-selinux-headers-4.12.5-1-x86_64.pkg.tar.xz
error: failed to init transaction (unable to lock database)
error: could not lock database: File exists
  if you're sure a package manager is not already
  running, you can remove /var/lib/pacman/db.lck
expect returned an error (1) when running: pacman -U ./linux-selinux/linux-selinux-4.12.5-1-x86_64.pkg.tar.xz ./linux-selinux/linux-selinux-docs-4.12.5-1-x86_64.pkg.tar.xz ./linux-selinux/linux-selinux-headers-4.12.5-1-x86_64.pkg.tar.xz
fishilico commented 7 years ago

Thanks for your report. I also experienced a slow relabeling process when installing large packages like kernels (linux-selinux, linux-hardened, etc.). The "Time out" message comes from the expect program in script build_and_install_all.sh, which was needed in order to install a package which conflicts with a core package.

There are therefore two issues, which I am addressing with two commits:

Could you please test these two commits?

sorin-mihai commented 7 years ago

I used the master branch, all seemed fine.