diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-16 18:19:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-16 18:19:48 +0000 |
commit | 68ea0ad933488166b8f6a9f8f2ea0287436cea25 (patch) | |
tree | 6ef163ae03d2463b703658a35f46a5807e32c36d /test/units/TEST-07-PID1.issue-33672.sh | |
parent | Adding upstream version 256.2. (diff) | |
download | systemd-68ea0ad933488166b8f6a9f8f2ea0287436cea25.tar.xz systemd-68ea0ad933488166b8f6a9f8f2ea0287436cea25.zip |
Adding upstream version 256.4.upstream/256.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/units/TEST-07-PID1.issue-33672.sh')
-rwxr-xr-x | test/units/TEST-07-PID1.issue-33672.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/units/TEST-07-PID1.issue-33672.sh b/test/units/TEST-07-PID1.issue-33672.sh new file mode 100755 index 0000000..370497c --- /dev/null +++ b/test/units/TEST-07-PID1.issue-33672.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + +set -eux +set -o pipefail + +# shellcheck source=test/units/util.sh +. "$(dirname "$0")"/util.sh + +# systemctl status always shows daemon-reload warning for a masked service with drop-ins +# Issue: https://github.com/systemd/systemd/issues/33672 + +UNIT=test-23-NeedDaemonReload.service + +cleanup() { + rm -rf /run/systemd/system/"$UNIT" /run/systemd/system/"$UNIT".d + systemctl daemon-reload +} + +trap cleanup EXIT + +cat > /run/systemd/system/"$UNIT" <<EOF +[Service] +ExecStart=/usr/bin/true +EOF + +mkdir /run/systemd/system/"$UNIT".d +cat > /run/systemd/system/"$UNIT".d/desc.conf <<EOF +[Unit] +Description=Test NeedDaemonReload status of a masked unit with drop-ins +EOF + +systemctl daemon-reload +systemctl unmask "$UNIT" +assert_eq "$(systemctl show -P NeedDaemonReload "$UNIT")" no + +systemctl mask "$UNIT" +assert_eq "$(systemctl show -P NeedDaemonReload "$UNIT")" no |