Bug#950533: upgrade fails in a chroot

2020-02-06 Thread Steve McIntyre
Hey Michael,

Apologies for taking a while to get back to you. Yay conference
week... :-/

On Mon, Feb 03, 2020 at 11:02:13AM +0100, Michael Biebl wrote:
>Am 03.02.20 um 09:59 schrieb Steve McIntyre:
>
>> ACL operation on "/var/log/journal" failed: No such file or directory
>> ACL operation on "/var/log/journal" failed: No such file or directory
>> Failed to re-open '/var/log/journal': No such file or directory
>> fchmod() of /var/log/journal failed: No such file or directory
>> dpkg: error processing package systemd (--configure):
>>  installed systemd package post-installation script subprocess returned 
>> error exit status 73
>> Errors were encountered while processing:
>>  systemd
>> E: Sub-process /usr/bin/dpkg returned an error code (1)
>> 
>> I don't have a /var/log/journal in those chroots.
>
>The error message is misleading. postinst does create a /var/log/journal
>directory. From a quick investigation with strace, the following seems
>relevant
>
>> getxattr("/proc/self/fd/4", "system.posix_acl_access", 0x7ffc2fdcc8c0, 132) 
>> = -1 ENOENT (No such file or directory)
>> writev(2, [{iov_base="ACL operation on \"/var/log/journ"..., iov_len=69}, 
>> {iov_base="\n", iov_len=1}], 2ACL operation on "/var/log/journal" failed: No 
>> such file or directory
>
>Mounting a proc fs inside the chroot does fix the failure for me.
>
>We run systemd-tmpfiles --create --prefix /var/log/journal
>after creating the directory to ensure proper permissions and ACLs are
>applied. Apparently this requires a mounted proc fs.
>
>https://salsa.debian.org/systemd-team/systemd/blob/debian/master/src/core/chown-recursive.c#L17
>
>A quick fix could be to guard the systemd-tmpfiles call with a
>
>if mountpoint -q /proc ; then
>...
>fi

ACK, and I see you've added that i git already. Thanks for the quick response!

-- 
Steve McIntyre, Cambridge, UK.st...@einval.com
"I used to be the first kid on the block wanting a cranial implant,
 now I want to be the first with a cranial firewall. " -- Charlie Stross



Bug#950533: upgrade fails in a chroot

2020-02-03 Thread Michael Biebl
Hi Steve,

thanks for the bug report.

Am 03.02.20 um 09:59 schrieb Steve McIntyre:

> ACL operation on "/var/log/journal" failed: No such file or directory
> ACL operation on "/var/log/journal" failed: No such file or directory
> Failed to re-open '/var/log/journal': No such file or directory
> fchmod() of /var/log/journal failed: No such file or directory
> dpkg: error processing package systemd (--configure):
>  installed systemd package post-installation script subprocess returned error 
> exit status 73
> Errors were encountered while processing:
>  systemd
> E: Sub-process /usr/bin/dpkg returned an error code (1)
> 
> I don't have a /var/log/journal in those chroots.

The error message is misleading. postinst does create a /var/log/journal
directory. From a quick investigation with strace, the following seems
relevant

> getxattr("/proc/self/fd/4", "system.posix_acl_access", 0x7ffc2fdcc8c0, 132) = 
> -1 ENOENT (No such file or directory)
> writev(2, [{iov_base="ACL operation on \"/var/log/journ"..., iov_len=69}, 
> {iov_base="\n", iov_len=1}], 2ACL operation on "/var/log/journal" failed: No 
> such file or directory

Mounting a proc fs inside the chroot does fix the failure for me.

We run systemd-tmpfiles --create --prefix /var/log/journal
after creating the directory to ensure proper permissions and ACLs are
applied. Apparently this requires a mounted proc fs.

https://salsa.debian.org/systemd-team/systemd/blob/debian/master/src/core/chown-recursive.c#L17

A quick fix could be to guard the systemd-tmpfiles call with a

if mountpoint -q /proc ; then
...
fi





signature.asc
Description: OpenPGP digital signature


Bug#950533: upgrade fails in a chroot

2020-02-03 Thread Steve McIntyre
Package: systemd
Version: 244.1-2
Severity: serious

Hi folks,

I'm guessing this is fallout from enabling persistent journal by
default, maybe. I have a development box running multiple chroots, and
ths sid chroots are now failing to upgradw with the following errors:

Upgrading from 240-5 to 244.1-2:

...
Need to get 0 B/5987 kB of archives.
After this operation, 444 kB of additional disk space will be used.
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)
Setting up systemd (244.1-2) ...
[/usr/lib/tmpfiles.d/systemd-tmp.conf:11] Failed to replace specifiers: 
/tmp/systemd-private-%b-*
[/usr/lib/tmpfiles.d/systemd-tmp.conf:12] Failed to replace specifiers: 
/tmp/systemd-private-%b-*/tmp
[/usr/lib/tmpfiles.d/systemd-tmp.conf:13] Failed to replace specifiers: 
/var/tmp/systemd-private-%b-*
[/usr/lib/tmpfiles.d/systemd-tmp.conf:14] Failed to replace specifiers: 
/var/tmp/systemd-private-%b-*/tmp
[/usr/lib/tmpfiles.d/systemd-tmp.conf:22] Failed to replace specifiers: 
/var/lib/systemd/coredump/.#core*.%b*
ACL operation on "/var/log/journal" failed: No such file or directory
ACL operation on "/var/log/journal" failed: No such file or directory
Failed to re-open '/var/log/journal': No such file or directory
fchmod() of /var/log/journal failed: No such file or directory
dpkg: error processing package systemd (--configure):
 installed systemd package post-installation script subprocess returned error 
exit status 73
Errors were encountered while processing:
 systemd
E: Sub-process /usr/bin/dpkg returned an error code (1)

I don't have a /var/log/journal in those chroots.

-- Package-specific info:

-- System Information:
Debian Release: 10.2
  APT prefers stable-debug
  APT policy: (500, 'stable-debug'), (500, 'stable'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-6-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_WARN, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages systemd depends on:
ii  adduser  3.118
ii  libacl1  2.2.53-4
ii  libapparmor1 2.13.2-10
ii  libaudit11:2.8.4-3
ii  libblkid12.33.1-0.1
ii  libc62.28-10
ii  libcap2  1:2.25-2
ii  libcryptsetup12  2:2.1.0-5+deb10u2
ii  libgcrypt20  1.8.4-5
ii  libgnutls30  3.6.7-4
ii  libgpg-error01.35-1
ii  libidn11 1.33-2.2
ii  libip4tc01.8.2-4
ii  libkmod2 26-1
ii  liblz4-1 1.8.3-1
ii  liblzma5 5.2.4-1
ii  libmount12.33.1-0.1
ii  libpam0g 1.3.1-5
ii  libseccomp2  2.3.3-4
ii  libselinux1  2.8-1+b1
ii  libsystemd0  241-7~deb10u2
ii  mount2.33.1-0.1
ii  util-linux   2.33.1-0.1

Versions of packages systemd recommends:
ii  dbus1.12.16-1
ii  libpam-systemd  241-7~deb10u2

Versions of packages systemd suggests:
ii  policykit-10.105-25
ii  systemd-container  241-7~deb10u2

Versions of packages systemd is related to:
pn  dracut   
ii  initramfs-tools  0.133+deb10u1
ii  udev 241-7~deb10u2

-- Configuration Files:
/etc/systemd/logind.conf changed [not included]

-- no debconf information