2013-02-02 20:27:55 +01:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
|
|
|
case "$1" in
|
2014-02-23 00:52:50 +01:00
|
|
|
configure)
|
2013-02-02 20:27:55 +01:00
|
|
|
SERVER_HOME=/var/lib/rspamd
|
|
|
|
SERVER_LOG=/var/log/rspamd
|
2014-02-23 09:33:05 +01:00
|
|
|
SERVER_USER=_rspamd
|
2013-02-02 20:27:55 +01:00
|
|
|
|
2014-02-23 00:57:37 +01:00
|
|
|
adduser --quiet \
|
|
|
|
--system \
|
|
|
|
--group \
|
|
|
|
--home $SERVER_HOME \
|
|
|
|
--no-create-home \
|
|
|
|
--disabled-login \
|
2014-03-06 22:08:53 +01:00
|
|
|
--gecos "rspamd spam filtering system" \
|
2014-02-23 09:46:28 +01:00
|
|
|
--force-badname \
|
2014-02-23 00:57:37 +01:00
|
|
|
$SERVER_USER
|
2015-12-17 19:28:56 +01:00
|
|
|
mkdir -p $SERVER_HOME $SERVER_LOG || true
|
2014-03-08 15:56:58 +01:00
|
|
|
chown $SERVER_USER: $SERVER_HOME $SERVER_LOG
|
2013-02-02 20:27:55 +01:00
|
|
|
;;
|
|
|
|
|
2014-02-23 00:52:50 +01:00
|
|
|
abort-*)
|
2013-02-02 20:27:55 +01:00
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
2014-02-23 00:52:50 +01:00
|
|
|
echo "postinst called with unknown argument \`$1'" >&2
|
2013-02-02 20:27:55 +01:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2015-03-07 11:23:13 +01:00
|
|
|
if [ -x /etc/init.d/rspamd ]; then
|
|
|
|
update-rc.d rspamd defaults >/dev/null
|
2015-05-16 21:28:57 +02:00
|
|
|
if [ -d /run/systemd/system ]; then
|
|
|
|
deb-systemd-invoke --system daemon-reload >/dev/null || true
|
|
|
|
deb-systemd-invoke --system stop rspamd.service 2>/dev/null || true
|
2015-03-07 11:23:13 +01:00
|
|
|
else
|
|
|
|
invoke-rc.d rspamd start || exit $?
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2014-02-23 10:58:19 +01:00
|
|
|
#DEBHELPER#
|
|
|
|
|
2013-02-02 20:27:55 +01:00
|
|
|
exit 0
|