mirror of
https://github.com/systemd/systemd.git
synced 2024-10-30 23:21:22 +03:00
Merge pull request #8330 from filbranden/masked1
Detect masked unit with drop-ins
This commit is contained in:
commit
3ab74d0a43
@ -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");
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user