From 2ddb3d23b067a37719b721fc07aee63479cad8fa Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 29 Jul 2014 14:53:30 +0200 Subject: [PATCH] Add a phplist service which processes queue and bounces every 5 minutes --- createlinks | 10 ++++++++++ root/var/service/phplist/log/run | 7 +++++++ root/var/service/phplist/run | 15 +++++++++++++++ smeserver-phplist.spec | 4 ++++ 4 files changed, 36 insertions(+) create mode 100644 root/var/service/phplist/log/run create mode 100644 root/var/service/phplist/run diff --git a/createlinks b/createlinks index 061c592..8afa460 100644 --- a/createlinks +++ b/createlinks @@ -10,3 +10,13 @@ safe_symlink("/etc/e-smith/templates-default/template-begin-php", "root/etc/e-sm safe_symlink("/etc/e-smith/templates-default/template-end-php", "root/etc/e-smith/templates/etc/phplist/config.php/template-end"); safe_symlink("/var/qmail/alias/.qmail-phplistbounces", "root/var/qmail/alias/.qmail-phplistbounces-default"); + +safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/phplist'); +safe_symlink("/var/service/phplist" , 'root/service/phplist'); +safe_touch("root/var/service/phplist/down"); +safe_symlink("sigterm", "root/etc/e-smith/events/webapps-update/services2adjust/phplist"); + +service_link_enhanced('phplist', 'S98', '7'); +service_link_enhanced('phplist', 'K12', '6'); +service_link_enhanced('phplist', 'K12', '0'); + diff --git a/root/var/service/phplist/log/run b/root/var/service/phplist/log/run new file mode 100644 index 0000000..565a130 --- /dev/null +++ b/root/var/service/phplist/log/run @@ -0,0 +1,7 @@ +#!/bin/sh + +exec \ + /usr/local/bin/setuidgid smelog \ + /usr/local/bin/multilog t n20 s10000000 \ + /var/log/phplist + diff --git a/root/var/service/phplist/run b/root/var/service/phplist/run new file mode 100644 index 0000000..7adfdc4 --- /dev/null +++ b/root/var/service/phplist/run @@ -0,0 +1,15 @@ +#!/bin/sh + +exec 2>&1 + +cd /usr/share/phplist/bin + +while true; do + exec \ + /usr/local/bin/setuidgid www \ + /usr/bin/php ./phplist -pprocessbounces \ + exec \ + /usr/local/bin/setuidgid www \ + /usr/bin/php ./phplist -pprocessqueue \ + sleep 300 +done diff --git a/smeserver-phplist.spec b/smeserver-phplist.spec index 660e561..ec2a638 100644 --- a/smeserver-phplist.spec +++ b/smeserver-phplist.spec @@ -55,6 +55,7 @@ running on SME Server %build perl ./createlinks %{__mkdir_p} %{buildroot}/var/lib/phplist +%{__mkdir_p} %{buildroot}/var/log/phplist %install rm -rf $RPM_BUILD_ROOT @@ -62,6 +63,9 @@ rm -rf $RPM_BUILD_ROOT rm -f %{name}-%{version}-filelist /sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ --dir /var/lib/phplist 'attr(0750,www,www)' \ + --dir /var/log/phplist 'attr(0750,smelog,smelog)' \ + --file /var/service/phplist/run 'attr(0750,root,root)' \ + --file /var/service/phplist/log/run 'attr(0750,root,root)' \ > %{name}-%{version}-filelist %files -f %{name}-%{version}-filelist