diff options
Diffstat (limited to 'pcr/rspamd/rspamd.install')
-rw-r--r-- | pcr/rspamd/rspamd.install | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/pcr/rspamd/rspamd.install b/pcr/rspamd/rspamd.install new file mode 100644 index 000000000..2261599e8 --- /dev/null +++ b/pcr/rspamd/rspamd.install @@ -0,0 +1,20 @@ +## arg 1: the new package version +post_install() { + if ! getent passwd _rspamd >/dev/null; then + useradd -k /dev/null -r -m -c 'rspam daemon' -d /var/lib/rspamd -s /sbin/nologin _rspamd + passwd -l _rspamd >/dev/null + fi + mkdir -p /var/log/rspamd + mkdir -p /run/rspamd + chown _rspamd:_rspamd /var/log/rspamd + chown _rspamd:_rspamd /run/rspamd +} + +## arg 1: the old package version +post_remove() { + if getent passwd _rspamd >/dev/null; then + userdel _rspamd + fi +} + +# vim:set ts=2 sw=2 et: |