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

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Fri, 14 Feb 2014 11:47:52 +1300

On 2014-02-14 11:32, Henrik Nordström wrote:
> tor 2014-02-13 klockan 09:43 -0700 skrev Alex Rousskov:
>
>> 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).
>
> yes.

This is "background daemon" mode, yes?

ie. no use of -N or use of "-N background"

>
>> "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.
>
> In my mind this is what -N is meant to be.

... and this as the "foreground daemon" mode, yes?

ie. use of "-N foreground"

Both are types of daemon in the init world. Just the foreground one has
access to terminal/TTY output, and the PID waiting abilities systemd etc
want to use.

Use of "-N" with no parameter produce an error.

>
>> "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.
>
> Exactly. "no forking" is more of a debug mode. Maybe time to add a
> --debug=... option to set various debug flags?
>
> --debug=nofork
>
> And also merge the -X flag into this.

Sounds reasonable.

Perhapse making both -N and -X take parameters now?
  -N for the process daemonization, and -X for the debug ones TBD.

BTW: I was thinking -M as shorthand for Master or Mode (longhand option:
--mode=foreground|background).

Amos
Received on Thu Feb 13 2014 - 22:47:55 MST

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