Skip to content
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

Start apache with exec #614

Merged
merged 2 commits into from
May 15, 2024
Merged

Start apache with exec #614

merged 2 commits into from
May 15, 2024

Conversation

bt90
Copy link
Contributor

@bt90 bt90 commented Apr 17, 2024

Currently we're directly starting apache2 from within the entrypoint script. This has some unintended side effects:

docker top speedtest
UID                 PID                 PPID                C                   STIME               TTY                 TIME                CMD
root                18397               18367               0                   20:22               ?                   00:00:00            bash /entrypoint.sh
root                18626               18397               0                   20:22               ?                   00:00:00            apache2 -DFOREGROUND
www-data            18726               18626               0                   20:22               ?                   00:00:00            apache2 -DFOREGROUND
www-data            18727               18626               0                   20:22               ?                   00:00:00            apache2 -DFOREGROUND
www-data            18728               18626               0                   20:22               ?                   00:00:00            apache2 -DFOREGROUND
www-data            18729               18626               0                   20:22               ?                   00:00:00            apache2 -DFOREGROUND
www-data            18730               18626               0                   20:22               ?                   00:00:00            apache2 -DFOREGROUND
www-data            18851               18626               0                   20:22               ?                   00:00:00            apache2 -DFOREGROUND
www-data            19298               18626               1                   20:23               ?                   00:00:00            apache2 -DFOREGROUND
www-data            19300               18626               0                   20:23               ?                   00:00:00            apache2 -DFOREGROUND
www-data            19301               18626               0                   20:23               ?                   00:00:00            apache2 -DFOREGROUND
www-data            19303               18626               0                   20:23               ?                   00:00:00            apache2 -DFOREGROUND

Note that the bash process remains alive all the time. The problem is that docker sends (stop) signals to the parent process, which in our case is bash. Without special traps, bash will simply ignore them.

Solution: let apache replace the bash process using exec

This also defines the proper stop signal expected by apache.

@bt90
Copy link
Contributor Author

bt90 commented May 14, 2024

@sstidl

@sstidl sstidl changed the base branch from master to dev May 15, 2024 04:32
@sstidl sstidl changed the base branch from dev to master May 15, 2024 04:34
@sstidl sstidl merged commit 8713fac into librespeed:master May 15, 2024
@bt90 bt90 deleted the patch-4 branch May 15, 2024 05:01
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.

2 participants