]> git.ipfire.org Git - thirdparty/systemd.git/commit
manager: skip reopening of console and signal reset when running as normal program 42099/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Fri, 15 May 2026 08:18:28 +0000 (10:18 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Fri, 15 May 2026 08:57:04 +0000 (10:57 +0200)
commit09f107c811a591efa90bd2cfb4982f82c955a349
tree09d8db5fa2c41844a89e3c6c0bd5c9674cb379ad
parent601684ba950424888bde568153addabade8d4627
manager: skip reopening of console and signal reset when running as normal program

We want to reopen the console used for logging when running as PID1, but
also when running a user manager (c.f. 48a601fe5de8aa0d89ba6dadde168769fa7ce992
and 2a646b1d624e510a79785e1268b55a9c3a441db5). But this can cause
problems when the binary is invoked directly, e.g. to print --help.
E.g. if we ignore SIGPIPE, we'd remain running briefly after
'/usr/lib/systemd/systemd --help | head -n1'.

Previusly, the getopt machinery would print to stderr unconditionally.
But after the rework of option parsing, which means that we use the
log_* functions to repor errors, the test that checks if we print errors
to stderr started failing.

So let's skip some more of the setup if !invoked_by_systemd().
src/core/main.c