summaryrefslogtreecommitdiffstats
path: root/adei/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'adei/scripts')
-rwxr-xr-xadei/scripts/run-apache.sh17
-rwxr-xr-xadei/scripts/run-cron.sh10
2 files changed, 23 insertions, 4 deletions
diff --git a/adei/scripts/run-apache.sh b/adei/scripts/run-apache.sh
index 3ad9d5f..90438a7 100755
--- a/adei/scripts/run-apache.sh
+++ b/adei/scripts/run-apache.sh
@@ -1,8 +1,19 @@
#! /bin/bash
-if [ ! -f /adei/cfg/apache.conf ]; then
- cp -a /opt/configs/apache* /adei/cfg
-fi
+LOCK_FILE=.lock
+(
+ flock -x 10
+ if [ ! -d /adei/ovr/apache2 ]; then
+ cp -ar /opt/apache2 /adei/ovr/
+ fi
+) 10> /adei/ovr/$LOCK_FILE
+
+(
+ flock -x 10
+ if [ ! -f /adei/cfg/apache.conf ]; then
+ cp -a /opt/configs/apache* /adei/cfg
+ fi
+) 10> /adei/cfg/$LOCK_FILE
sed -i'' -re '/Listen/ { /(80|443)/!d }' /etc/apache2/listen.conf
if [ -n "$ADEI_PORTS" ]; then
diff --git a/adei/scripts/run-cron.sh b/adei/scripts/run-cron.sh
index 5f4b9e2..f0539f6 100755
--- a/adei/scripts/run-cron.sh
+++ b/adei/scripts/run-cron.sh
@@ -2,6 +2,14 @@
printenv | grep -v affinity:container | sed -r 's/^(.*)=("?)(.*)\2$/export \1="\3"/g' > /adei/env
-/opt/scripts/adei-branch.sh
+LOCK_FILE=.lock
+(
+ flock -x 10
+ flock -x 11
+
+ /opt/scripts/adei-branch.sh
+
+) 10> /adei/cfg/$LOCK_FILE 11> /adei/src/$LOCK_FILE
+
cron -n -m '/usr/bin/procmail -d root'