diff options
author | Valery Kartel <valery.kartel@gmail.com> | 2016-01-25 01:01:54 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2016-02-02 11:13:17 +0000 |
commit | e0a970d758b6a0f7cd4101057fd7b74151a43c26 (patch) | |
tree | 86ce1eebcd2df21c19b21f0ec52d78559d399069 /testing/rmilter/rmilter.initd | |
parent | 380f84d5ef54b75bda5296d44b07dce2c8152881 (diff) | |
download | aports-e0a970d758b6a0f7cd4101057fd7b74151a43c26.tar.bz2 aports-e0a970d758b6a0f7cd4101057fd7b74151a43c26.tar.xz |
testing/rmilter: new aport
Rspamd milter (mail filter for postfix, sendmail etc.)
https://rspamd.com
Diffstat (limited to 'testing/rmilter/rmilter.initd')
-rw-r--r-- | testing/rmilter/rmilter.initd | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/testing/rmilter/rmilter.initd b/testing/rmilter/rmilter.initd new file mode 100644 index 0000000000..10ea136d36 --- /dev/null +++ b/testing/rmilter/rmilter.initd @@ -0,0 +1,45 @@ +#!/sbin/openrc-run + +description="Rapid spam defence mail filter" +user=${user:-rmilter} +group=${group:-rmilter} +cfgfile=${cfgfile:-/etc/rmilter/rmilter.conf} +pidfile=$(grep pidfile $cfgfile | cut -d = -f 2 | sed 's/[ ;]//g') +pidfile=${pidfile:-/run/rmilter/rmilter.pid} +sockfile=$(grep bind_socket $cfgfile | grep unix: | cut -d : -f 2 | sed 's/[ ;]//g') +command=/usr/sbin/rmilter +command_args="-c $cfgfile" +required_files="$cfgfile" +extra_started_commands="reload" +description_reload="Reload configuration" + +depend() { + need net dns localmount + use logger antivirus antispam +} + +start_pre() { + ebegin + checkpath --directory --mode 750 --owner $user:$group ${pidfile%/*} + if [ "$sockfile" ]; then + checkpath --directory --mode 750 --owner $user:$group ${sockfile%/*} + rm -f $sockfile + fi + eend $? +} + +start() { + ebegin "Starting ${SVCNAME}" + start-stop-daemon --start \ + --user $user \ + --group $group \ + --pidfile $pidfile \ + --exec $command -- $command_args + eend $? +} + +reload() { + ebegin "Reloading ${SVCNAME}" + start-stop-daemon --signal USR1 --pidfile $pidfile + eend $? +} |