Re: Fwd: [CTTE #727708] Default init system for Debian

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Thu, 13 Feb 2014 09:43:39 -0700

On 02/11/2014 03:16 PM, Amos Jeffries wrote:
> On 2014-02-12 11:07, Henrik Nordström wrote:
>> But seriously, it's a very small change to Squid. All systemd and the
>> like needs is that Squid stops all the backgrounding, setsid etc done in
>> watch_child(). The rest is business as usual, including watching childs.
...
>> for now probably best by using yet another command line option. The
>> opt_no_daemon flag (-N) is far too overloaded and used at a bit too many
>> places today and trying to sort that out is likely to give some more
>> gray hairs.

I agree that no single -N semantics will satisfy everybody.

Please note that we can still safely and sanely use "-N with a
parameter" to implement any new-and-improved semantics around the same
feature area without adding new command line options if we want. In
other words, we can, but do not have to add more options. This "-N with
a parameter" approach is covered by item (a) from my November 1 2013
email on the "[RFC] Squid process model" thread:

> a) Add an optional parameter to -N to be able to switch between
> "no forking" and "no daemon" semantics. For example, if "-N" is
> interpreted as "No", we can have:
> -N # default (to be decided)
> -N daemon # Master process runs in foreground but SMP allowed
> -N fork # No forking at all and, hence, no SMP.
>
> b) Change -N semantics from current "no forking" to "no daemon"
> and add another option to enable "no forking" semantics.
>
> c) Leave -N semantics as current "no forking"
> and add another option to enable "no daemon" semantics.

I am not sure which approach is the best, but I am sure we need to
clearly define and document the new semantics to avoid repeating -N
problems which were caused primarily by folks (including myself)
interpreting what -N means differently and changing the code according
to their own misguided interpretation.

For example, we can define the following three modes:

"daemon" -- Master process forks and uses setsid (what else?). No other
effects on Squid. For example, SMP works by forking kid processes as
needed. Meant for stand-alone execution. This is the default (enabled
when no related command line options are given).

"no daemon" -- "Daemonization" steps listed in the above paragraph are
disabled. Thus, the master process does not fork and does not use setsid
(what else?). No other effects on Squid. For example, SMP works by
forking kid processes as needed. Meant for systemd and such.

"no forking" -- Squid runs a single Squid process, which works both as a
master process and the only worker process. No kid processes, no SMP.
Meant for debugging and triage.

HTH,

Alex.
Received on Thu Feb 13 2014 - 16:43:44 MST

This archive was generated by hypermail 2.2.0 : Fri Feb 14 2014 - 12:00:12 MST