all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH pmg-api] d/postinst: do not error out on chown/chmod /var/spool/pmg/
@ 2026-06-22  8:21 Stoiko Ivanov
  0 siblings, 0 replies; only message in thread
From: Stoiko Ivanov @ 2026-06-22  8:21 UTC (permalink / raw)
  To: pmg-devel

When /var/spool/pmg is a dedicated mountpoint on an unpriviledged
container, its `.lost+found` is not writeable by root inside the
container.

In this case - it makes sense to not cause postinst to error-out, as
the failing change of mode/ownership is not problematic.

I don't think that it's a too common setup, but as /var/spool/pmg is
one of the places which does grow with more usage (quarantined files)
having it on a separate mount-point can make sense.

I considered guarding all the changes of metadata with '|| true', but
as failing to change ownership will result in broken mail-processing
for most of the changes it seems better to fail during apt to have the
user notice the issue as early as possible.

reported in our community forum:
https://forum.proxmox.com/threads/184240/post-858302

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 debian/postinst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/postinst b/debian/postinst
index ee218ab9..ce514ade 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -40,8 +40,8 @@ migrate_pmg_smtp_filter() {
 
     printf "Adjusting group ownership of the mail spool, this might take a while\n"
     # no -v: the spool can hold millions of mails
-    chgrp -R pmg /var/spool/pmg
-    chmod -R g+w /var/spool/pmg
+    chgrp -R pmg /var/spool/pmg || true
+    chmod -R g+w /var/spool/pmg || true
 
     chgrp -Rv pmg /etc/pmg/dkim
     chmod -Rv g+rX /etc/pmg/dkim
-- 
2.47.3





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-22  8:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-22  8:21 [PATCH pmg-api] d/postinst: do not error out on chown/chmod /var/spool/pmg/ Stoiko Ivanov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal