[pve-devel] [PATCH] Fix postinst script when qga is installed

Thomas Lamprecht t.lamprecht at proxmox.com
Mon May 27 19:38:19 CEST 2019


On 5/27/19 6:21 PM, Stoiko Ivanov wrote:
> While testing a few upgrades on virtualized machines I noted that pve-qemu-kvm
> always broke while running the postinst script:
> ```
> Setting up pve-qemu-kvm (3.0.1-61) ...
> rmdir: failed to remove '/etc/qemu': Directory not empty
> dpkg: error processing package pve-qemu-kvm (--configure):
>  installed pve-qemu-kvm package post-installation script subprocess
>   returned error exit status 1
> ```
> 
> A quick check showed that qemu-guest-agent in buster ships the following files:
> ```
> /etc/qemu
> /etc/qemu/fsfreeze-hook
> /etc/qemu/fsfreeze-hook.d
> ```
> 
> One packages postinst script should not remove directories which are also used
> by other packages.
> 
> Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
> ---
> Tested shortly by building the patched version on buster and installing on top
> of a broken version - it worked.
> 
> We could consider completely dropping the script since most other invocations
> don't do too much, but emitting a warning and exiting cleanly.
> From the git blame output it seems that the script was already present for
> pve-4 and we should now be save to drop it entirely?

see:
https://git.proxmox.com/?p=pve-qemu-kvm.git;a=commitdiff;h=8b7e35182aba87372ba5da5d322791557b744c15

for history..

yes, just left-over cruft which should've been dropped earlier..
I did a git rm on it with your name sprinkled into the commit message,
thanks a lot!


> 
> 
> debian/postinst | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/debian/postinst b/debian/postinst
> index ddf9452..494a994 100755
> --- a/debian/postinst
> +++ b/debian/postinst
> @@ -9,7 +9,7 @@ case "$1" in
>      # remove stale /etc/qemu (files are in /etc/kvm)
>      # file is now in /usr/share/kvm/cpus-x86_64.conf
>      rm -f /etc/qemu/target-x86_64.conf
> -    if test -d /etc/qemu; then rmdir /etc/qemu; fi
> +    if test -d /etc/qemu; then rmdir --ignore-fail-on-non-empty /etc/qemu; fi
>      rm -f /etc/kvm/target-x86_64.conf
>  
>      # There are three sub-cases:
> 





More information about the pve-devel mailing list