[pmg-devel] applied: [PATCH pmg-api] d/maintscripts: prevent aborting on errors in some commands

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Jun 2 10:23:31 CEST 2023


Am 31/03/2023 um 13:27 schrieb Stoiko Ivanov:
> in case something goes wrong it is often better to not leave the
> packaging state broken.
> 
> failure in the commands masked by this patch are either transient
> (pmgconfig sync -restart 1 failing when services are masked), or will
> be noticed quite instantly (failed database or config initialization
> upon first install)
> 
> the deb-systemd-invoke change was based on a quick grep in
> /var/lib/dpkg/info on my system
> 
> I quickly considered masking even more errors (e.g. related to the ucf
> handling) - but they don't seem to cause issues (in the past 3 years)
> - and if something breaks there it is probably worth to get a report
> 
> reported in our community forum:
> https://forum.proxmox.com/threads/.125088/
> 
> Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
> ---
> This patch should fix the issue - I considered the suggestions discussed
> off-list with making the reload command not fail when the config-rewrite
> issues it - but doing so in general feels wrong.
> Ignoring a failure if a service is masked did not seem robust - e.g.
> masking 'postfix.service' does not result in 'postfix at -' being masked as
> well, and still a reload of 'postfix at -' service fails (and explicitly
> listing this one edge-case felt a bit brittle)
> Finally not erroring out in `pmgconfig sync -restart 1` felt off as it's
> the direct entry point for the user - and masking an error should be the
> caller's responsibility
> 
> Reproduced the issue from the forum with a 7.2 installation and masking
> all services as in the upgrade guide[0] before upgrading and with this
> patch the upgrade does not result in a broken dpkg state anymore
> 
> [0] https://pmg.proxmox.com/wiki/index.php/Upgrade_from_6.x_to_7.0
> 
>  debian/postinst | 6 +++---
>  debian/prerm    | 2 +-
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
>

applied, thanks!




More information about the pmg-devel mailing list