]> git.ipfire.org Git - thirdparty/squid.git/commit
Fix option --foreground to implement expected behavior
authorAndreas Weigel <andreas.weigel@securepoint.de>
Thu, 29 Jun 2017 10:53:05 +0000 (22:53 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 29 Jun 2017 10:53:05 +0000 (22:53 +1200)
commita75ea465c59f044e73fcc0008b80225aebdf7c7e
tree8a6e4fbc1a13aaddf3ff6463ba75b97801cec037
parent0f20460e08195a71efaa607430857030da50d0b6
Fix option --foreground to implement expected behavior

... and allow usage of SMP mode with service supervisors that do not work
well with daemons.

Currently, --foreground behavior is counter-intuitive in that the launched
process, while staying in the foreground, forks another "master" process,
which will create additional children (kids), depending on the number of
configured workers/diskers.

Furthermore, sending a SIGINT/SIGTERM signal to this foreground process
terminates it, but leaves all the children running.

The behavior got introduced with v4 rev.14561.

From discussion on squid-dev, the following behavior is implemented:

* -N: The initial process is a master and a worker process.
  No kids.
  No daemonimization.

* --foreground: The initial process is the master process.
  One or more worker kids (depending on workers=N).
  No daemonimization.

* neither: The initial process double-forks the master process.
  One or more worker kids (depending on workers=N).
  Daemonimization.

The Release Notes for v4 were updated to reflect the corrected behavior.
doc/release-notes/release-4.sgml
src/main.cc