1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-08 05:57:26 +03:00

41854 Commits

Author SHA1 Message Date
Kevin Kuehler
1d75e29b23 shared/ask-password-api: modify keyctl break value
We can break if KEYCTL_READ return value is equal to our buffer size.

From keyctl(2):

On a successful return, the return value is always the total size of
the payload data.  To determine whether the buffer was of sufficient
size, check to see that the return value is less than or equal to the
value supplied in arg4.

(cherry picked from commit 6da498c28f2598bea4d651756485f57d54e379f4)
2019-12-15 12:16:52 +01:00
Michal Sekletár
a16b1ee7e5 cryptsetup: reduce the chance that we will be OOM killed
cryptsetup introduced optional locking scheme that should serialize
unlocking keyslots which use memory hard key derivation
function (argon2). Using the serialization should prevent OOM situation
in early boot while unlocking encrypted volumes.

(cherry picked from commit 408c81f62454684dfbff1c95ce3210d06f256e58)
2019-12-15 12:16:26 +01:00
Lennart Poettering
4836fb010a core: write out correct field name when creating transient service units
(cherry picked from commit f14bf013126ebcdc689995234cb15fc0b605a262)
2019-12-15 12:15:59 +01:00
Martin Wilck
3e2c547f6d udevd: don't use monitor after manager_exit()
If udevd receives an exit signal, it releases its reference on the udev
monitor in manager_exit(). If at this time a worker is hanging, and if
the event timeout for this worker expires before udevd exits, udevd
crashes in on_sigchld()->udev_monitor_send_device(), because the monitor
has already been freed.

Fix this by testing the validity of manager->monitor in on_sigchld().

(cherry picked from commit 030f4571670537c76355c5d923468c9a61aa77e9)
2019-12-15 12:15:39 +01:00
Martin Wilck
d42f7d45a8 Revert "udevd: fix crash when workers time out after exit is signal caught"
This reverts commit 5db454b8031c58a743cc4ee3d5d1dd01dcff17e8.
See https://github.com/systemd/systemd/issues/14128

(cherry picked from commit 3cabdc2345608b01e344a52fe6f8c3c378406ebc)
2019-12-15 12:15:39 +01:00
Paul Menzel
c9a287eee8 man/systemd.link: Add missing verb *be*
(cherry picked from commit a19b9a382711110c99365a24bd4da2b848f2b7d5)
2019-12-15 12:15:23 +01:00
Zbigniew Jędrzejewski-Szmek
a67a3ae04b man: document all pager variables for systemctl and systemd
In those two pages, we need to include individual entries with xi:include to
merge the list less-variables.xml with the other entries, which is obviously
error prone. All variables are supported in both tools so add them.

(cherry picked from commit 3d58bfc01c9283eded77736990ea09b0ee4f6e23)
2019-12-15 12:13:42 +01:00
Mike Kazantsev
3a8fce3f38 core.timer: fix "systemd-analyze dump" and docs syntax inconsistencies wrt OnTimezoneChange=
(cherry picked from commit 0810e396284998afef945f982304bc86d245e26d)
2019-12-15 12:13:12 +01:00
Zbigniew Jędrzejewski-Szmek
fdffd284b6 core/service: downgrade "scheduling restart" message to debug
I see we log this during every boot, even though it is a routine expected event:
Nov 12 14:50:01 krowka systemd[1]: systemd-journald.service: Service has no hold-off time (RestartSec=0), scheduling restart.
(and for other services too). Let's downgrade this to debug level.

https://bugzilla.redhat.com/show_bug.cgi?id=1614871
(cherry picked from commit 868f7d36cc26552cc7377a6a81913fa8803bc3bb)
2019-12-15 12:11:25 +01:00
Yu Watanabe
733e7f19d3 travis: add missing closing quote sign
Fixes #14127.

(cherry picked from commit 8c99d40d47292e8c1be8c159943a2d8781b9d3e9)
2019-12-15 12:10:38 +01:00
Pascal de Bruijn
0d7b7817fc systemd-tmpfiles: don't install timer when service isn't installed either
Fixes: systemd-tmpfiles-clean.timer: Refusing to start, unit
systemd-tmpfiles-clean.service to trigger not loaded.

(cherry picked from commit b4e2236a724274887c561434468387d4945ec61e)
2019-12-15 12:09:14 +01:00
Lennart Poettering
0e7f83cd2b pam_systemd: prolong method call timeout when allocating session
Starting a session might involve starting the user@.service instance,
hence let's make the bus call timeout substantially longer.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=83828
(cherry picked from commit fbcb630045f9d13d6d4b16ba376b0cf27bf1e2d5)
2019-12-15 12:05:37 +01:00
Yu Watanabe
e51d9bf9e5 man: add entry about SpeedMeter=
Closes #14002.

(cherry picked from commit c9fdaed079524942445a1bbbb975766768ad9b04)
v243.4
2019-11-19 11:07:31 +01:00
Yu Watanabe
aa1fc791c7 udev: silence warning about PROGRAM+= or IMPORT+= rules
Closes #14062.

(cherry picked from commit f0beb6f816035e438d684cc52ae76fc4a44fc197)
2019-11-19 11:07:31 +01:00
Yu Watanabe
b9a619bb67 udevadm: ignore EROFS and return earlier
Fixes #14060.

(cherry picked from commit dc11d2bf6602558770e61f772d925ba8dcc71233)
2019-11-19 11:07:31 +01:00
Cyprien Laplace
1ec5b9f80c basic: add vmware hypervisor detection from device-tree
Allow ConditionVirtualization=vmware to work on ESXi on arm VMs
using device-tree.

(cherry picked from commit 4d4ac92c928fcbc60b85fcbf8370af3883ee63db)
2019-11-19 11:07:31 +01:00
Lennart Poettering
7fa7080248 umount: be happy if /proc/swaps doesn't exist
Kernels work without swap just fine.

Fixes: #13993
(cherry picked from commit 2cdd0d612d18732db845f2f44f217d6e00c62010)
2019-11-19 11:07:31 +01:00
Lennart Poettering
71ccd774bb shutdown: make logging more useful if NULL swap/mount table files are specified
Makes the error output seen in #13993 more readable.

(cherry picked from commit f795267e3ad419c1f40dec0d3aef77cb8db3b841)
2019-11-19 11:07:31 +01:00
Zbigniew Jędrzejewski-Szmek
38453c6d42 man: share description of $SYSTEMD_COLORS in other tools
It was only described in systemd(1), making it hard to discover.
Fixes #13561.

The same for $SYSTEMD_URLIFY.

I think all the tools whose man pages include less-variables.xml support
those variables.

(cherry picked from commit 339bf2076b3294e5f7b59e84c59ba8c55ded3c25)
2019-11-19 11:07:31 +01:00
Zbigniew Jędrzejewski-Szmek
b50ca01526 core: do not propagate polkit error to caller
If we fail to start polkit, we get a message like
"org.freedesktop.DBus.Error.NameHasNoOwner: Could not activate remote peer.",
which has no meaning for the caller of our StartUnit method. Let's just
return -EACCES.

$ systemctl start apache
Failed to start apache.service: Could not activate remote peer. (before)
Failed to start apache.service: Access denied                   (after)

Fixes #13865.

(cherry picked from commit 7edd8fb198f3e8a95677df8a8f5016ed40dcff54)
2019-11-19 11:07:31 +01:00
Lennart Poettering
99b72a66ca ask-password: don't hit assert() when we query pw which the user C-d and caching is enabled
(cherry picked from commit e013e10d0e96917b627d54f20e3dba80a17df0d5)
2019-11-19 11:07:31 +01:00
Zbigniew Jędrzejewski-Szmek
288edd6869 man: mention $RUNTIME_DIRECTORY & friends in environment list
(cherry picked from commit 1f6597a84cd3891a69a630c6c4b168da46b1c160)
2019-11-19 11:07:31 +01:00
Zbigniew Jędrzejewski-Szmek
37aeadd433 cryptsetup-generator: guess whether the keyfile argument is two items or one
Fixes #13615.

See the inline comment for documentation.

(cherry picked from commit 32c6237a7c2e697d2fc4f3403319db16858fb8e3)
2019-11-19 11:07:31 +01:00
HATAYAMA Daisuke
a87e8fdc72 verify: fix segmentation fault
systemd-analyze verify command now results in segmentation fault if two
consecutive non-existent unit file names are given:

    # ./build/systemd-analyze a.service b.service
    ...<snip irrelevant part>...
    Unit a.service not found.
    Unit b.service not found.
    Segmentation fault (core dumped)

The cause of this is a wrong handling of return value of
manager_load_startable_unit_or_warn() in verify_units() in failure case.

It looks that the current logic wants to assign the first error status
throughout verify_units() into variable r and count up variable count only when
a given unit file exists.

However, due to the wrong handling of the return value of
manager_load_startable_unit_or_warn() in verify_units(), the variable count is
unexpectedly incremented even when there is no such unit file because the
variable r already contains non-zero value in the 2nd failure, set by the 1st
failure, and then the condition k < 0 && r == 0 evaluates to false.

This commit fixes the wrong handling of return value of
manager_load_startable_unit_or_warn() in verify_units().

(cherry picked from commit fc9de36a3b60c69a17442aabf215e2d87e697e6f)
2019-11-19 11:07:31 +01:00
Lennart Poettering
3aea728cd2 timedated: it might be that tzinfo files are just not installed
(cherry picked from commit 5322db0651e1c29b61e2b42764b538722106522c)
2019-11-19 11:07:31 +01:00
Lennart Poettering
cc103c72ab timedated: handle UTC specially, when generating /etc/localtime
(cherry picked from commit 9193af0f059538f4e5ca06502a998e9cc02819a1)
2019-11-19 11:07:31 +01:00
Lennart Poettering
f5a4caa541 time-util: treat /etc/localtime missing as UTC
(cherry picked from commit bc9ecd484f1ebfe0de8b567c90f6cd867fbd5894)
2019-11-19 11:07:31 +01:00
Zbigniew Jędrzejewski-Szmek
2139d58652 bpf: fix off-by-one in class whitelisting
We would jump one insn too many, landing in the middle of the subsequent block.

(cherry picked from commit a72a5326a47733f057d1bea1ddb319b779165f8d)
2019-11-19 11:07:31 +01:00
Zbigniew Jędrzejewski-Szmek
cb7693595d bpf: fix device type filter
On big endian arches, we were taking the wrong half-word, so the check
was giving bogus results.

https://bugzilla.redhat.com/show_bug.cgi?id=1769148.
(cherry picked from commit 415fe5ec7d38db5e8e0b97c68e462734f543ad17)
2019-11-19 11:07:31 +01:00
Zbigniew Jędrzejewski-Szmek
56e1ba304b core: constify bpf program arrays
In cases where the programs were modified after being initially declared,
reorder operations so that the declaration is already in final form.

(cherry picked from commit 2899aac46a8d8d5cf1aa5cbf04f755ef7b9f9643)
2019-11-19 11:07:31 +01:00
Zbigniew Jędrzejewski-Szmek
b06b7ace92 run: propagate return code/status from the child
Fixes #13756. We were returning things that didn't make much sense:
we would always use the exit_code value as the exit code. But it sometimes
contains a exit code from the process, and sometimes the number of a signal
that was used to kill the process. We would also ignore SuccessExitStatus=
and in general whether systemd thinks the service exited successfully
(hence the issue in #13756, where systemd would return success/SIGTERM,
but we'd just look at the SIGTERM part.)

If we are doing --wait, let's always propagate the exit code/status from
the child.

While at it, make the documentation useful.

(cherry picked from commit 7f3614e5479446bbd5a2bdf6aed4962e8d803e35)
2019-11-19 11:07:31 +01:00
Martin Wilck
5db454b803 udevd: fix crash when workers time out after exit is signal caught
If udevd receives an exit signal, it releases its reference on the udev
monitor in manager_exit(). If at this time a worker is hanging, and if
the event timeout for this worker expires before udevd exits, udevd
crashes in on_sigchld()->udev_monitor_send_device(), because the monitor
has already been freed.

Fix this by releasing the main process's monitor ref later, in
manager_free().

(cherry picked from commit 7b6596d7489421842af854ed16333ea747879732)
2019-11-19 11:07:31 +01:00
Yu Watanabe
b774282a85 udev: ignore error caused by device disconnection
During an add or change event, the device may be disconnected.

Fixes #13976.

(cherry picked from commit b64b83d13eedfdfc616c16c4a108ef28bf6d3b33)
2019-11-19 11:07:31 +01:00
Yu Watanabe
8d88a2ecd7 udev: fix error code in the log message
(cherry picked from commit ffdc9c891f00f79aa7df3ac25ad141db74686fbe)
2019-11-19 11:07:31 +01:00
Yu Watanabe
c41484a2f3 udev: ignore ENOENT when chmod_and_chown() device node
(cherry picked from commit 4b613ec212bfd06fd9d9487bd37b0791fa6dff9e)
2019-11-19 11:07:31 +01:00
Yu Watanabe
f218b65b32 udev: do not append newline when write attributes
Before 25de7aa7b90c23d33ea50ada1e50c5834a414237, the content is written
by `fprintf()` without new line. So WRITE_STRING_FILE_AVOID_NEWLINE flag
is necessary.

Fixes #13985.

(cherry picked from commit a566ed2c82d81cc6416fe0da0a14f6d5fe5d83b4)
2019-11-19 11:07:31 +01:00
Lennart Poettering
ce4d17ddbc time-util: uniquify timezone list, in case UTC is listed in timezone1970.tab, too
(cherry picked from commit 55fd6dca071d3a83da31d2c5d106adba0a380f8c)
2019-11-19 11:07:31 +01:00
Lennart Poettering
28f0b34c57 time-util: always accept UTC as valid timezone
We already handle it specially in get_timezones(), hence we should OK it
here too, even if the timezone file doesn't actually exist.

Prompted by:

https://serverfault.com/questions/991172/invalid-time-zone-utc

(Yes, Ubuntu should install the UTC timezone data unconditionally: it
should not be an option, even if all other timezone data is excluded,
but since it's our business to validate user input but not out business
to validate distros, let's just accept "UTC" unconditionally, it's magic
after all)

(cherry picked from commit e8b9e9c4705b4bc157ff460371387339977f233b)
2019-11-19 11:07:31 +01:00
Zbigniew Jędrzejewski-Szmek
8b888d2360 seccomp: add all *time64 syscalls
From https://bugzilla.redhat.com/show_bug.cgi?id=1770154:
> utime is an obsolete system call. The current kernel interface is
> utimensat_time64. New 32-bit architectures do not even provide the utime
> system call.

Also add all other *time64 syscalls listed in
https://fedora.juszkiewicz.com.pl/syscalls.html.

(cherry picked from commit 6ca677106992321326427c89a40e1c9673a499b2)
2019-11-19 11:07:31 +01:00
Michal Suchanek
53d8feeb23 libblkid: open device in nonblock mode.
When autoclose is set (kernel default but many distributions reverse the
setting) opening a CD-rom device causes the tray to close.

The function of blkid is to report the current state of the device and
not to change it. Hence it should use O_NONBLOCK when opening the
device to avoid closing a CD-rom tray.

blkid is used liberally in scripts so it can potentially interfere with
the user operating the CD-rom hardware.

[kzak@redhat.com: add O_NONBLOCK also to:
                  - wipefs
                  - blkid_new_probe_from_filename()
                  - blkid_evaluate_tag()]

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 39f5af25982d8b0244000e92a9d0e0e6557d0e17)
(cherry picked from commit 581e2d96fccde1d367ead9f12fadf4a1ea6affe3)
2019-11-19 11:07:30 +01:00
Zbigniew Jędrzejewski-Szmek
b9478046b0 man: describe ordering in case of Conflicts=
Fixes #13421.

(cherry picked from commit 38c432b37c1db7b02f9d6bd7a864a7aa88571441)
2019-11-19 11:07:30 +01:00
Zbigniew Jędrzejewski-Szmek
fa3e5bd2bb man: put description of Wants= above Requires=
We want users to use Wants, but we'd describe Requires first and ask users to
look for Wants instead. While at it, let's split the wall of text into sensible
paragraphs: syntax first, followed by semantics and longer description, and
finally hints and comparison to other configuration items last.

(cherry picked from commit d19cd71a8a6dca4565d7d1c8766127b70c10ebe0)
2019-11-19 11:07:30 +01:00
Zbigniew Jędrzejewski-Szmek
bdebd2c325 meson: remove strange dep that causes meson to enter infinite loop
The value is obviously bogus, but didn't seem to cause problems so far.
With meson-0.52.0, it causes a hang. The number of aliases is always rather
small (usually just one or two, possibly up to a dozen in a few cases), so
even if this causes some looping, it is strange that it has such a huge impact.
But let's just remove it.

Fixes #13742.

Tested with meson-0.52.0-1.module_f31+6771+f5d842eb.noarch,
meson-0.51.1-1.fc29.noarch.

(cherry picked from commit af336643a01d0b210b18312c253a50594ba54b0a)
2019-11-19 11:07:30 +01:00
Dominique Martinet
26bc77d8e5 man: fix option typo in pam_systemd man page
The session= option does not exist, XDG_SESSION_TYPE overrides the type=
option.

(cherry picked from commit 98647fa0faaff21b53f8a01b9804fc0669fb6d19)
2019-11-19 11:07:30 +01:00
Anita Zhang
9c12127e3d man: save pull-raw example file without underscores
Destination file needs to be a valid hostname and underscores
are not valid hostname characters.

Closes #13542

(cherry picked from commit b12a67ae145ce01d3dc97fc76fed8c1698125dc6)
2019-11-19 11:07:30 +01:00
Anita Zhang
4c106cbcf1 man: small grammatical/word choice fixes to crypttab man page
Closes #13608

(cherry picked from commit 7792d9cdd484dcd8552cce0ea778eb09ed7fbc10)
2019-11-19 11:07:30 +01:00
Zbigniew Jędrzejewski-Szmek
03cc374fca shared/format-table: disable ellipsization when piped
Fixes #13461.

Before:
$ systemd-inhibit --no-pager
WHO            UID  USER    PID   COMM           WHAT                                  WHY          MODE
ModemManager   0    root    1093  ModemManager   sleep                                 ModemManage… delay
NetworkManager 0    root    1400  NetworkManager sleep                                 NetworkMana… delay
UPower         0    root    5141  upowerd        sleep                                 Pause devic… delay
zbyszek        1000 zbyszek 10036 gsd-power      handle-lid-switch                     External mo… block
zbyszek        1000 zbyszek 10035 gsd-media-keys handle-power-key:handle-suspend-key:… GNOME handl… block
zbyszek        1000 zbyszek 10035 gsd-media-keys sleep                                 GNOME handl… delay
zbyszek        1000 zbyszek 10036 gsd-power      sleep                                 GNOME needs… delay

7 inhibitors listed.
$ systemd-inhibit --no-pager|grep suspend
$ systemd-inhibit --no-pager|cat
WHO            UID  USER    PID   COMM           WHAT                WHY   MODE
ModemManager   0    root    1093  ModemManager   sleep               Mode… delay
NetworkManager 0    root    1400  NetworkManager sleep               Netw… delay
UPower         0    root    5141  upowerd        sleep               Paus… delay
zbyszek        1000 zbyszek 10036 gsd-power      handle-lid-switch   Exte… block
zbyszek        1000 zbyszek 10035 gsd-media-keys handle-power-key:h… GNOM… block
zbyszek        1000 zbyszek 10035 gsd-media-keys sleep               GNOM… delay
zbyszek        1000 zbyszek 10036 gsd-power      sleep               GNOM… delay

After:
$ build/systemd-inhibit --no-pager
(same as above)

$ build/systemd-inhibit --no-pager|grep suspend
zbyszek        1000 zbyszek 10035 gsd-media-keys handle-power-key:handle-suspend-key:handle-hibernate-key GNOME handling keypresses                                   block
$ build/systemd-inhibit --no-pager|cat
WHO            UID  USER    PID   COMM           WHAT                                                     WHY                                                         MODE
ModemManager   0    root    1093  ModemManager   sleep                                                    ModemManager needs to reset devices                         delay
NetworkManager 0    root    1400  NetworkManager sleep                                                    NetworkManager needs to turn off networks                   delay
UPower         0    root    5141  upowerd        sleep                                                    Pause device polling                                        delay
zbyszek        1000 zbyszek 10036 gsd-power      handle-lid-switch                                        External monitor attached or configuration changed recently block
zbyszek        1000 zbyszek 10035 gsd-media-keys handle-power-key:handle-suspend-key:handle-hibernate-key GNOME handling keypresses                                   block
zbyszek        1000 zbyszek 10035 gsd-media-keys sleep                                                    GNOME handling keypresses                                   delay
zbyszek        1000 zbyszek 10036 gsd-power      sleep                                                    GNOME needs to lock the screen                              delay

7 inhibitors listed.

Note that this affect all tools that use format-table.c: machinectl, busctl,
loginctl, systemd-analyze, networkctl, portablectl.

(cherry picked from commit 0db41a8f1f8eda49ce60e7efa23d17a5e24673e3)
2019-11-19 11:07:30 +01:00
Yu Watanabe
0a5497d3fa sd-device-enumerator: do not return error when a device is removed
Fixes #13814.

(cherry picked from commit 3126d64e5f04cd39033f8c5055e80440b8680d86)
2019-11-19 11:07:30 +01:00
Lennart Poettering
7b0d0331d0 bootctl: create leading dirs when "bootctl random-seed" is called if needed
Prompted by: #13603

(cherry picked from commit a4a55e9ace3e97ee35c89bb2964330cba69e4edb)
2019-11-19 11:07:30 +01:00
HATAYAMA Daisuke
5aab35aac9 core, job: fix breakage of ordering dependencies by systemctl reload command
Currently, systemctl reload command breaks ordering dependencies if it's
executed when its target service unit is in activating state.

For example, prepare A.service, B.service and C.target as follows:

    # systemctl cat A.service B.service C.target
    # /etc/systemd/system/A.service
    [Unit]
    Description=A

    [Service]
    Type=oneshot
    ExecStart=/usr/bin/echo A1
    ExecStart=/usr/bin/sleep 60
    ExecStart=/usr/bin/echo A2
    ExecReload=/usr/bin/echo A reloaded
    RemainAfterExit=yes

    # /etc/systemd/system/B.service
    [Unit]
    Description=B
    After=A.service

    [Service]
    Type=oneshot
    ExecStart=/usr/bin/echo B
    RemainAfterExit=yes

    # /etc/systemd/system/C.target
    [Unit]
    Description=C
    Wants=A.service B.service

Start them.

    # systemctl daemon-reload
    # systemctl start C.target

Then, we have:

    # LANG=C journalctl --no-pager -u A.service -u B.service -u C.target -b
    -- Logs begin at Mon 2019-09-09 00:25:06 EDT, end at Thu 2019-10-24 22:28:47 EDT. --
    Oct 24 22:27:47 localhost.localdomain systemd[1]: Starting A...
    Oct 24 22:27:47 localhost.localdomain systemd[1]: A.service: Child 967 belongs to A.service.
    Oct 24 22:27:47 localhost.localdomain systemd[1]: A.service: Main process exited, code=exited, status=0/SUCCESS
    Oct 24 22:27:47 localhost.localdomain systemd[1]: A.service: Running next main command for state start.
    Oct 24 22:27:47 localhost.localdomain systemd[1]: A.service: Passing 0 fds to service
    Oct 24 22:27:47 localhost.localdomain systemd[1]: A.service: About to execute: /usr/bin/sleep 60
    Oct 24 22:27:47 localhost.localdomain systemd[1]: A.service: Forked /usr/bin/sleep as 968
    Oct 24 22:27:47 localhost.localdomain systemd[968]: A.service: Executing: /usr/bin/sleep 60
    Oct 24 22:27:52 localhost.localdomain systemd[1]: A.service: Trying to enqueue job A.service/reload/replace
    Oct 24 22:27:52 localhost.localdomain systemd[1]: A.service: Merged into running job, re-running: A.service/reload as 1288
    Oct 24 22:27:52 localhost.localdomain systemd[1]: A.service: Enqueued job A.service/reload as 1288
    Oct 24 22:27:52 localhost.localdomain systemd[1]: A.service: Unit cannot be reloaded because it is inactive.
    Oct 24 22:27:52 localhost.localdomain systemd[1]: A.service: Job 1288 A.service/reload finished, result=invalid
    Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Passing 0 fds to service
    Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: About to execute: /usr/bin/echo B
    Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Forked /usr/bin/echo as 970
    Oct 24 22:27:52 localhost.localdomain systemd[970]: B.service: Executing: /usr/bin/echo B
    Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Failed to send unit change signal for B.service: Connection reset by peer
    Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Changed dead -> start
    Oct 24 22:27:52 localhost.localdomain systemd[1]: Starting B...
    Oct 24 22:27:52 localhost.localdomain echo[970]: B
    Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Child 970 belongs to B.service.
    Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Main process exited, code=exited, status=0/SUCCESS
    Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Changed start -> exited
    Oct 24 22:27:52 localhost.localdomain systemd[1]: B.service: Job 1371 B.service/start finished, result=done
    Oct 24 22:27:52 localhost.localdomain systemd[1]: Started B.
    Oct 24 22:27:52 localhost.localdomain systemd[1]: C.target: Job 1287 C.target/start finished, result=done
    Oct 24 22:27:52 localhost.localdomain systemd[1]: Reached target C.
    Oct 24 22:27:52 localhost.localdomain systemd[1]: C.target: Failed to send unit change signal for C.target: Connection reset by peer
    Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Child 968 belongs to A.service.
    Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Main process exited, code=exited, status=0/SUCCESS
    Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Running next main command for state start.
    Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Passing 0 fds to service
    Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: About to execute: /usr/bin/echo A2
    Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Forked /usr/bin/echo as 972
    Oct 24 22:28:47 localhost.localdomain systemd[972]: A.service: Executing: /usr/bin/echo A2
    Oct 24 22:28:47 localhost.localdomain echo[972]: A2
    Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Child 972 belongs to A.service.
    Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Main process exited, code=exited, status=0/SUCCESS
    Oct 24 22:28:47 localhost.localdomain systemd[1]: A.service: Changed start -> exited

The issue occurs not only in reload command, i.e.:

  - reload
  - try-restart
  - reload-or-restart
  - reload-or-try-restart commands

The cause of this issue is that job_type_collapse() doesn't take care of the
activating state.

Fixes: #10464
(cherry picked from commit d1559793df555212271e490a4a72f55826caf5b4)
2019-11-19 11:07:30 +01:00