From b3df1b0b2a61f71ca94fbce5662b447b9acc016f Mon Sep 17 00:00:00 2001 From: Steven Mondji-Lerider Date: Wed, 24 Apr 2013 14:33:49 +0000 Subject: [PATCH] Configuring use of do_action.php by incron ( same way as update_domains.sh ) --- .gitattributes | 1 + debian/alternc.postinst | 3 +++ etc/alternc/templates/incron.d/alternc | 2 +- src/inotify_do_actions.sh | 14 ++++++++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 src/inotify_do_actions.sh diff --git a/.gitattributes b/.gitattributes index 28d48777..be34601b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -558,6 +558,7 @@ src/fixperms.sh -text src/functions.sh -text src/functions_dns.sh -text src/functions_hosting.sh -text +src/inotify_do_actions.sh -text src/inotify_update_domains.sh -text src/lxc_stopexpired.php -text src/mail_dodelete.php -text diff --git a/debian/alternc.postinst b/debian/alternc.postinst index 4424df2a..545d9356 100644 --- a/debian/alternc.postinst +++ b/debian/alternc.postinst @@ -119,6 +119,9 @@ ALTERNC_SLAVES="" # File to look at for forced launch of update_domain (use incron) INOTIFY_UPDATE_DOMAIN="/var/run/alternc/inotify_update_domain.lock" +# File to look at for forced launch of do_actions (use incron) +INOTIFY_UPDATE_DOMAIN="/var/run/alternc/inotify_do_action.lock" + # AlternC Locations ALTERNC_HTML="" ALTERNC_MAIL="" diff --git a/etc/alternc/templates/incron.d/alternc b/etc/alternc/templates/incron.d/alternc index 258c4f2f..236bb523 100644 --- a/etc/alternc/templates/incron.d/alternc +++ b/etc/alternc/templates/incron.d/alternc @@ -1,4 +1,4 @@ # WARNING: Do not edit this file, edit the one in /etc/alternc/templates and launch alternc.install again. /var/run/alternc/ IN_CREATE,IN_ATTRIB,IN_NO_LOOP /usr/lib/alternc/inotify_update_domains.sh -/var/run/alternc/inotify_do_action.lock IN_CREATE,IN_ATTRIB,IN_NO_LOOP /usr/lib/alternc/do_actions.php +/var/run/alternc/ IN_CREATE,IN_ATTRIB,IN_NO_LOOP /usr/lib/alternc/inotify_do_actions.sh diff --git a/src/inotify_do_actions.sh b/src/inotify_do_actions.sh new file mode 100755 index 00000000..ff6b17c3 --- /dev/null +++ b/src/inotify_do_actions.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# Launch do_actions.php if $INOTIFY_DO_ACTION exist + +. /etc/alternc/local.sh + +LOGGER="/usr/bin/logger" + +if [ -e "$INOTIFY_DO_ACTION" ] ; then + if [ -x "$LOGGER" ] ; then + $LOGGER -t ALTERNC do_actions + fi + /usr/lib/alternc/do_actions.php +fi