Use of "exec" in apachectl in a Docker environment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear All,
For setting up a webserver in a small docker container it is good practice to run the server in the foreground via "exec"
See E.g. https://github.com/docker-library/httpd/blob/master/2.4/httpd-foreground
This ensures that the apache binary gets PID 1 and signals are propagated (and I think zombies are reaped).

However sometimes it would be nice to use the apachectl script for this, since it loads environment variables, ...
Currently does not work, since inside apachectl the actual apache programm is called without "exec". The result is that the apachectl script remains with PID 1 and e.g. signals (like USR1) for the container get not propagated correctly to the apache process.
If one patches the apachectl so that all calls to the apache binary are done with "exec", everthing works as expected.
(e.g. for debian `sed -i 's/\($HTTPD ${APACHE_ARGUMENTS}\)/exec \1/' /usr/sbin/apache2ctl` )
Might it be a sensible change in the apachectl to always call the binary with "exec" (at least on the systems where exec exists)
Thanks
 Best
 Martin

------------------------------------------------------------------------ 
Dr. Martin Köhler 
Head of library and documentation 
                        Deutsches Elektronen-Synchrotron - DESY 
Building 01d Room O1.443 
phone:  +49-40-8998-1814                                   Notkestr. 85 
fax:    +49-40-8994-1814                                   22607 Hamburg 
e-mail: Martin.Koehler@xxxxxxx                             Germany 
------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx





[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux