NTTCom-MS / eyp-postfix

postfix management - relay or multidomain mailserver
Apache License 2.0
0 stars 10 forks source link

Ubuntu: don't change postfix uid #62

Closed juju4 closed 6 years ago

juju4 commented 6 years ago

Ubuntu 18.04

Notice: /Stage[main]/Postfix/Exec[postfix mkdir /etc/pki/tls/private]/returns: executed successfully
Notice: /Stage[main]/Postfix/Exec[postfix mkdir /etc/pki/tls/certs]/returns: executed successfully
Notice: /Stage[main]/Postfix/Exec[openssl pk]/returns: executed successfully
Notice: /Stage[main]/Postfix/Exec[openssl cert]/returns: executed successfully
Info: /Stage[main]/Postfix/Exec[openssl cert]: Scheduling refresh of Class[Postfix::Service]
Notice: /Stage[main]/Postfix/Package[mailutils]/ensure: created
Notice: /Stage[main]/Postfix/Group[postfix]/gid: gid changed 117 to 89
Error: Could not set uid on user[postfix]: Execution of '/usr/sbin/usermod -u 89 postfix' returned 8: usermod: user postfix is currently used by process 4220
Error: /Stage[main]/Postfix/User[postfix]/uid: change from 112 to 89 failed: Could not set uid on user[postfix]: Execution of '/usr/sbin/usermod -u 89 postfix' returned 8: usermod: user postfix is currently used by process 4220
Notice: /Stage[main]/Postfix/File[/var/lib/postfix]: Dependency User[postfix] has failures: true
Warning: /Stage[main]/Postfix/File[/var/lib/postfix]: Skipping because of failed dependencies

relevant part of the code https://github.com/NTTCom-MS/eyp-postfix/blob/b753fb7cb459fe6db9e93ac5f517d6826fc2d2ed/manifests/params.pp#L68 so adding a facts could be a way.

but looking at multiple Ubuntu install, postfix uid seems variable. any option to let it as is?

Thanks

jordiprats commented 6 years ago

Hi, The real problem here is that Debian and derived like Ubuntu starts services on install by default.

There's no clean way to do it via puppet: reference, so if you want to let puppet change it just stop postfix and reapply puppet, otherwise you need to set postfix_username_uid and postfix_username_gid to the appropiate value

best regards,