[pmg-devel] [PATCH pmg-api v5 05/11] postinstall: add new group for shared functionality

Maximiliano Sandoval m.sandoval at proxmox.com
Mon Aug 25 16:13:38 CEST 2025


Stoiko Ivanov <s.ivanov at proxmox.com> writes:

> TIL: `systemd-sysusers` - thanks!
> looks fine - a short comment/link to why the flag to `dh` is (still?)
> needed would help me here

The `dh` flag was added in the compatibility level v14 which if I am not
wrong is still open for development, this means it has the feature has
to be enabled explicitly. See [1, 2] for more details.

[1] https://manpages.debian.org/trixie/debhelper/debhelper.7.en.html#COMPATIBILITY_LEVELS
[2] https://manpages.debian.org/trixie/debhelper/debhelper-compat-upgrade-checklist.7.en.html

>
> On Fri,  4 Apr 2025 15:14:32 +0200
> Maximiliano Sandoval <m.sandoval at proxmox.com> wrote:
>
>> A shared group named 'pmg' is introduced for processes that need to be
>> accessible from multiple processes like spamassassin, rrdcached or the
>> mail queue at /var/spool/pmg.
>> 
>> Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
>> ---
>>  debian/pmg-api.sysusers | 1 +
>>  debian/postinst         | 4 ++++
>>  debian/rules            | 2 +-
>>  3 files changed, 6 insertions(+), 1 deletion(-)
>>  create mode 100644 debian/pmg-api.sysusers
>> 
>> diff --git a/debian/pmg-api.sysusers b/debian/pmg-api.sysusers
>> new file mode 100644
>> index 00000000..a546c45f
>> --- /dev/null
>> +++ b/debian/pmg-api.sysusers
>> @@ -0,0 +1 @@
>> +g pmg             -               -
>> diff --git a/debian/postinst b/debian/postinst
>> index 708350ec..9af65ebf 100644
>> --- a/debian/postinst
>> +++ b/debian/postinst
>> @@ -49,6 +49,10 @@ migrate_apt_auth_conf() {
>>  }
>>  
>>  migrate_pmg_smtp_filter() {
>> +    systemd-sysusers
>> +
>> +    chown :pmg /var/lib/pmg
>> +
>>      pmgdb update >/dev/null 2>&1 &
>>  }
>>  
>> diff --git a/debian/rules b/debian/rules
>> index 3e150795..ea8f110c 100755
>> --- a/debian/rules
>> +++ b/debian/rules
>> @@ -13,7 +13,7 @@ include debian/rules.env
>>  export REPOID=${REPOID_GENERATED}
>>  
>>  %:
>> -	dh $@
>> +	dh $@ --with installsysusers
>>  
>>  override_dh_installsystemd:
>>  	dh_installsystemd --no-start --no-stop-on-upgrade \

-- 
Maximiliano




More information about the pmg-devel mailing list