forked from systemd/systemd-stable
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(cherry picked from commit 8b6de9e6381b39f59c936d2b0c6ce47f1b70a19e) (cherry picked from commit f81659f5f37eec39182e98ae02608c28de0ed292)
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/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" | ||
# FIXME: should be "no" | ||
assert_eq "$(systemctl show -P NeedDaemonReload "$UNIT")" yes |