Merge pull request #8330 from filbranden/masked1

Detect masked unit with drop-ins
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-03-02 11:24:31 +01:00 committed by GitHub
commit 3ab74d0a43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -1461,6 +1461,9 @@ static int unit_file_search(
return -ENOENT;
}
if (info->type == UNIT_FILE_TYPE_MASKED)
return result;
/* Search for drop-in directories */
dropin_dir_name = strjoina(info->name, ".d");

View file

@ -179,6 +179,16 @@ test_masked_dropins () {
ln -sf ../b.service /usr/lib/systemd/system/a.service.wants/b.service
check_ko a Wants b.service
# 'a' is masked but has an override config file
echo "*** test a is masked but has an override"
create_services a b
ln -sf /dev/null /etc/systemd/system/a.service
cat >/usr/lib/systemd/system/a.service.d/override.conf <<EOF
[Unit]
After=b.service
EOF
check_ok a UnitFileState masked
# 'b1' is an alias for 'b': masking 'b' dep should not influence 'b1' dep
echo "*** test a wants b, b1, and one is masked"
create_services a b