]> git.ipfire.org Git - thirdparty/systemd.git/commit
install: make unit_file_get_list aware of UNIT_FILE_INDIRECT 375/head
authorMichal Sekletar <msekleta@redhat.com>
Thu, 25 Jun 2015 14:44:22 +0000 (16:44 +0200)
committerMichal Sekletar <msekleta@redhat.com>
Thu, 25 Jun 2015 14:56:53 +0000 (16:56 +0200)
commit8508ea9d05242afa8f4748ea01890f521fef0d9f
tree7e81c61827d67aeea285b5d300c7454954aa872d
parent906fa490769c4bdb3be1e90ac7d16f66120608c7
install: make unit_file_get_list aware of UNIT_FILE_INDIRECT

Commit aedd401 introduced new unit file state, UNIT_FILE_INDIRECT. Unit file is
said to have indirect state if it contains [Install] section which has only
Also= directive. Thus, if enable of such unit file is requested then some other
unit file gets enabled.

Whether or not unit file is in indirect state can be determined by calling
unit_file_can_install. Function unit_file_get_list populates list of unit files
present in given lookup location. So far it did call unit_file_can_install in a
way that would prevent finding out about unit files in indirect state. Such unit
file would be incorrectly marked as static.

Fixes following assertion in test-install,

Assertion 'p->state == s' failed at src/test/test-install.c:59, function main(). Aborting.
[1]    26868 abort (core dumped)  ./test-install
src/shared/install.c