]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/shared/install.h
shared/install: in install_context_mark_for_removal ignore not found units
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 17 Oct 2016 00:56:31 +0000 (20:56 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 19 Oct 2016 01:30:47 +0000 (21:30 -0400)
commit19539807b597274275271c82113e8eb2850bb19f
tree4eceeca8ec4de7abfc03edfb5080ee0fcac6fe12
parent010454b459ef59bab2f9ddd994e4f50491ced371
shared/install: in install_context_mark_for_removal ignore not found units

With the following test case:
[Install]
WantedBy= default.target
Also=foobar-unknown.service

disabling would fail with:
$ ./systemctl --root=/ disable testing.service
Cannot find unit foobar-unknown.service.       # this is level debug
Failed to disable: No such file or directory.  # this is the error

After the change we proceed:
$ ./systemctl --root=/ disable testing.service
Cannot find unit foobar-unknown.service.
Removed /etc/systemd/system/default.target.wants/testing.service.

This does not affect specifying a missing unit directly:
$ ./systemctl --root=/ disable nosuch.service
Failed to disable: No such file or directory.
src/shared/install.c
src/shared/install.h