Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1131026 > unrolled thread

Bug#1027476: cron: postrm script fails because expected dpkg-statoverride is not present

Started by"Kevin P. Fleming" <kevin@km6g.us>
First post2023-01-01 14:00 +0100
Last post2023-01-10 06:00 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.debian.bugs.dist


Contents

  Bug#1027476: cron: postrm script fails because expected dpkg-statoverride is not present "Kevin P. Fleming" <kevin@km6g.us> - 2023-01-01 14:00 +0100
    Bug#1027476: cron: postrm script fails because expected dpkg-statoverride is not present Jonas Smedegaard <dr@jones.dk> - 2023-01-02 22:10 +0100
    Bug#1027476: closed by Debian FTP Masters <ftpmaster@ftp-master.debian.org> (reply to Georges Khaznadar <georgesk@debian.org>) (Bug#1027476: fixed in cron 3.0pl1-155) Guillem Jover <guillem@debian.org> - 2023-01-10 06:00 +0100

#1131026 — Bug#1027476: cron: postrm script fails because expected dpkg-statoverride is not present

From"Kevin P. Fleming" <kevin@km6g.us>
Date2023-01-01 14:00 +0100
SubjectBug#1027476: cron: postrm script fails because expected dpkg-statoverride is not present
Message-ID<FJ66u-eOUD-9@gated-at.bofh.it>
Package: cron
Version: 3.0pl1-154
Severity: normal

Dear Maintainer,

The postrm script in the current version of the cron package assumes the
presence of a dpkg-statoverride for /usr/bin/crontab, but no such statoverride
is present on my systems. As a result when I try to 'purge' the cron package
the process fails.

Recipe to reproduce the issue:

1) cd /root
2) mkdir foo
3) debootstrap --variant=minbase --include=logrotate,systemd-cron bookworm
4) chroot /root/foo /bin/bash
5) apt remove --purge cron

This results in the following output:

Reading package lists... Done
Building dependency tree... Done
The following packages will be REMOVED:
  cron*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)
(Reading database ... 11054 files and directories currently installed.)
Purging configuration files for cron (3.0pl1-154) ...
dpkg-statoverride: warning: no override present
dpkg: error processing package cron (--purge):
 installed cron package post-removal script subprocess returned error exit
status 2
Errors were encountered while processing:
 cron
E: Sub-process /usr/bin/dpkg returned an error code (1)

Editing /var/lib/dpkg/info/cron.postrm to remove the first section resolves the
issue.


-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.0.0-6-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages cron depends on:
ii  cron-daemon-common   3.0pl1-154
ii  init-system-helpers  1.65.2
ii  libc6                2.36-7
ii  libpam-runtime       1.5.2-5
ii  libpam0g             1.5.2-5
ii  libselinux1          3.4-1+b4
ii  sensible-utils       0.0.17

Versions of packages cron recommends:
ii  msmtp-mta [mail-transport-agent]  1.8.22-1

Versions of packages cron suggests:
pn  checksecurity           <none>
ii  logrotate               3.21.0-1
ii  systemd-cron [anacron]  1.15.19-2+b1

[toc] | [next] | [standalone]


#1131350

FromJonas Smedegaard <dr@jones.dk>
Date2023-01-02 22:10 +0100
Message-ID<FJAed-f8Bg-17@gated-at.bofh.it>
In reply to#1131026

[Multipart message — attachments visible in raw view] — view raw

Control: severity -1 serious

According to Debian Policy §6.6, "all postrm actions must only rely on
essential packages and must gracefully skip any actions that require the
package’s dependencies if those dependencies are unavailable."

This bug is therefore serious.

 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/
 * Sponsorship: https://ko-fi.com/drjones

 [x] quote me freely  [ ] ask before reusing  [ ] keep private

[toc] | [prev] | [next] | [standalone]


#1132568 — Bug#1027476: closed by Debian FTP Masters <ftpmaster@ftp-master.debian.org> (reply to Georges Khaznadar <georgesk@debian.org>) (Bug#1027476: fixed in cron 3.0pl1-155)

FromGuillem Jover <guillem@debian.org>
Date2023-01-10 06:00 +0100
SubjectBug#1027476: closed by Debian FTP Masters <ftpmaster@ftp-master.debian.org> (reply to Georges Khaznadar <georgesk@debian.org>) (Bug#1027476: fixed in cron 3.0pl1-155)
Message-ID<FMeTT-gRWe-3@gated-at.bofh.it>
In reply to#1131026
Control: reopen -1

Hi!

Although I've not tested nor checked the affected code, the fix done
to close this cannot possibly be correct, see below. :)

On Mon, 2023-01-09 at 21:27:06 +0000, Debian Bug Tracking System wrote:
> Date: Sun, 01 Jan 2023 07:12:58 -0500
> From: "Kevin P. Fleming" <kevin@km6g.us>
> To: Debian Bug Tracking System <submit@bugs.debian.org>
> Subject: cron: postrm script fails because expected dpkg-statoverride is
>  not present

> The postrm script in the current version of the cron package assumes the
> presence of a dpkg-statoverride for /usr/bin/crontab, but no such statoverride
> is present on my systems. As a result when I try to 'purge' the cron package
> the process fails.

I think the description might be read incorrectly. The error is not
that the dpkg-statoverride program is missing, as that's not possible
(w/o force) being part of dpkg which is an Essential package. But that
a statoverride entry setup by some package is missing.

> This results in the following output:
> 
> Reading package lists... Done
> Building dependency tree... Done
> The following packages will be REMOVED:
>   cron*
> 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
> After this operation, 0 B of additional disk space will be used.
> Do you want to continue? [Y/n] y
> perl: warning: Setting locale failed.
> perl: warning: Please check that your locale settings:
>         LANGUAGE = (unset),
>         LC_ALL = (unset),
>         LANG = "en_US.UTF-8"
>     are supported and installed on your system.
> perl: warning: Falling back to the standard locale ("C").
> E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)
> (Reading database ... 11054 files and directories currently installed.)
> Purging configuration files for cron (3.0pl1-154) ...
> dpkg-statoverride: warning: no override present

As can be seen here, the tool is executed and it runs, but it warns that
it cannot find the statoverride entry.

> dpkg: error processing package cron (--purge):
>  installed cron package post-removal script subprocess returned error exit
> status 2
> Errors were encountered while processing:
>  cron
> E: Sub-process /usr/bin/dpkg returned an error code (1)
> 
> Editing /var/lib/dpkg/info/cron.postrm to remove the first section resolves the
> issue.

Adding a dependency on dpkg cannot have solved anything here.

Thanks,
Guillem

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.bugs.dist


csiph-web