Skip to content

Commit f2bd9a3

Browse files
twang2218tianon
authored andcommitted
Setup the APACHE_RUN_DIR and APACHE_LOCK_DIR directories in runtime to avoid --tmpfs /run error
Fixes #250 Signed-off-by: Tao Wang <[email protected]>
1 parent d7181e0 commit f2bd9a3

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

5.6/apache/apache2-foreground

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,17 @@ if test -f "$APACHE_ENVVARS"; then
1010
. "$APACHE_ENVVARS"
1111
fi
1212

13-
# Apache gets grumpy about PID files pre-existing
1413
: "${APACHE_PID_FILE:=${APACHE_RUN_DIR:=/var/run/apache2}/apache2.pid}"
14+
15+
# setup directories and permissions
16+
mkdir -p /run/lock
17+
for dir in ${APACHE_RUN_DIR} ${APACHE_LOCK_DIR}
18+
do
19+
mkdir -p ${dir}
20+
chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"
21+
done
22+
23+
# Apache gets grumpy about PID files pre-existing
1524
rm -f "$APACHE_PID_FILE"
1625

1726
exec apache2 -DFOREGROUND "$@"

7.0/apache/apache2-foreground

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,17 @@ if test -f "$APACHE_ENVVARS"; then
1010
. "$APACHE_ENVVARS"
1111
fi
1212

13-
# Apache gets grumpy about PID files pre-existing
1413
: "${APACHE_PID_FILE:=${APACHE_RUN_DIR:=/var/run/apache2}/apache2.pid}"
14+
15+
# setup directories and permissions
16+
mkdir -p /run/lock
17+
for dir in ${APACHE_RUN_DIR} ${APACHE_LOCK_DIR}
18+
do
19+
mkdir -p ${dir}
20+
chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"
21+
done
22+
23+
# Apache gets grumpy about PID files pre-existing
1524
rm -f "$APACHE_PID_FILE"
1625

1726
exec apache2 -DFOREGROUND "$@"

7.1/apache/apache2-foreground

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,17 @@ if test -f "$APACHE_ENVVARS"; then
1010
. "$APACHE_ENVVARS"
1111
fi
1212

13-
# Apache gets grumpy about PID files pre-existing
1413
: "${APACHE_PID_FILE:=${APACHE_RUN_DIR:=/var/run/apache2}/apache2.pid}"
14+
15+
# setup directories and permissions
16+
mkdir -p /run/lock
17+
for dir in ${APACHE_RUN_DIR} ${APACHE_LOCK_DIR}
18+
do
19+
mkdir -p ${dir}
20+
chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"
21+
done
22+
23+
# Apache gets grumpy about PID files pre-existing
1524
rm -f "$APACHE_PID_FILE"
1625

1726
exec apache2 -DFOREGROUND "$@"

0 commit comments

Comments
 (0)