aboutsummaryrefslogtreecommitdiffstats
path: root/community/rspamd/rspamd.post-upgrade
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2018-07-25 02:13:58 +0200
committerJakub Jirutka <jakub@jirutka.cz>2018-07-25 02:52:12 +0200
commit51d7f21cb1cd1b2a475ae0106d93b64d667ee20e (patch)
treeae89197fe85452064df46c340a57e413b44dd6df /community/rspamd/rspamd.post-upgrade
parentbfd042a2dfb36acd7c82d37d06e3aaa2759a8225 (diff)
downloadaports-51d7f21cb1cd1b2a475ae0106d93b64d667ee20e.tar.bz2
aports-51d7f21cb1cd1b2a475ae0106d93b64d667ee20e.tar.xz
community/rspamd: rewrite init script, start as unprivileged user
It's init/rc system's job to daemonize process and drop privileges!
Diffstat (limited to 'community/rspamd/rspamd.post-upgrade')
-rw-r--r--community/rspamd/rspamd.post-upgrade12
1 files changed, 12 insertions, 0 deletions
diff --git a/community/rspamd/rspamd.post-upgrade b/community/rspamd/rspamd.post-upgrade
new file mode 100644
index 0000000000..cf3e277ddf
--- /dev/null
+++ b/community/rspamd/rspamd.post-upgrade
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+ver_new="$1"
+ver_old="$2"
+
+if [ "$(apk version -t "$ver_old" '1.7.8-r1')" = '<' ]; then
+ if [ "$(stat -c %U:%G /var/log/rspamd)" = 'root:rspamd' ]; then
+ chown rspamd:rspamd /var/log/rspamd
+ fi
+fi
+
+exit 0