Skip to content

Setup the $APACHE_RUN_DIR and $APACHE_LOCK_DIR directories in runtime #330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 26, 2017

Conversation

twang2218
Copy link
Contributor

Fix #250

Signed-off-by: Tao Wang [email protected]

@tianon
Copy link
Member

tianon commented Dec 6, 2016

Hmm, when I read through #250, I thought Mutex was simply a mutex on Apache itself to ensure it doesn't run more than once -- reading through https://httpd.apache.org/docs/2.4/mod/core.html#mutex, it sounds like it's actually quite a bit more than that, and controls some inter-process coordination too (especially for modules). 😞 😕

@twang2218 twang2218 changed the title Disable 'Mutex' and 'PidFile' settings to avoid --tmpfs /run error Setup the $APACHE_RUN_DIR and $APACHE_LOCK_DIR directories in runtime Dec 12, 2016
@twang2218 twang2218 force-pushed the tmpfs branch 2 times, most recently from 825d6da to eb7d5a3 Compare December 12, 2016 00:44
@twang2218
Copy link
Contributor Author

Ok, back to the original problem, it's because there is no /var/run/apache2/ and /var/run/lock/apache2 directories, so how about we create those directories during the runtime?

I changed my PR to creating and setup permissions on $APACHE_RUN_DIR and $APACHE_LOCK_DIR in apache2-forground:

# setup directories and permissions
mkdir -p /run/lock
for dir in ${APACHE_RUN_DIR} ${APACHE_LOCK_DIR}
do
	mkdir -p ${dir}
	chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"
done

@twang2218
Copy link
Contributor Author

ping @tianon

@twang2218
Copy link
Contributor Author

Any updates?

@tianon tianon force-pushed the tmpfs branch 2 times, most recently from e42d2e3 to a23b6fa Compare January 26, 2017 00:25
@tianon tianon requested a review from yosifkit January 26, 2017 00:26
… to handle edge cases in a less hard-coded manner
@tianon
Copy link
Member

tianon commented Jan 26, 2017

Before:

$ updog --tmpfs /run php:7-apache
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:/var/lock/apache2

After:

$ updog --tmpfs /run 7ecd801f4282
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.14. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.14. Set the 'ServerName' directive globally to suppress this message
[Thu Jan 26 00:27:51.493503 2017] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.10 (Debian) PHP/7.1.1 configured -- resuming normal operations
[Thu Jan 26 00:27:51.493548 2017] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'

@yosifkit yosifkit merged commit fe1ff7e into docker-library:master Jan 26, 2017
tianon added a commit to infosiftr/stackbrew that referenced this pull request Jan 27, 2017
- `bash`: 4.4.12
- `golang`: 1.7.5, 1.8rc3
- `mysql`: add automatic SSL support matching upstream behavior (docker-library/mysql#259)
- `openjdk`: debian 9~b154-1
- `php`: auto-create `APACHE_RUN_DIR` and `APACHE_LOCK_DIR` at runtime if necessary (docker-library/php#330)
- `postgres`: keep `include` for building against (docker-library/postgres#247)
- `rabbitmq`: add Alpine variant (docker-library/rabbitmq#137)
- `wordpress`: 4.7.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants