systemctl: resolve symlinks when finding unit paths (#4545)
authorFelipe Sateler <fsateler@users.noreply.github.com>
Sat, 12 Nov 2016 02:28:06 +0000 (23:28 -0300)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 12 Nov 2016 02:28:06 +0000 (21:28 -0500)
commitc6dd36b65caa9acc03a8e77b7db752574cf36eb4
tree122d9a897b8d228fabb708941bfb8bdaff1516ca
parentf40771a58025b79b1eab554e68647d397392ea37
systemctl: resolve symlinks when finding unit paths (#4545)

Otherwise we think the alias is the real unit, and may edit/cat the
wrong unit.

Before this patch:
 $ systemctl edit autovt@ # creates dropin in /etc/systemd/system/autovt@.service.d
 $ systemctl cat autovt@ | grep @.service
 # /lib/systemd/system/autovt@.service
 # that serial gettys are covered by serial-getty@.service, not this
 # /etc/systemd/system/autovt@.service.d/override.conf
 $ systemctl cat getty@ | grep @.service
 # /lib/systemd/system/getty@.service
 # that serial gettys are covered by serial-getty@.service, not this

After this patch
 $ systemctl edit autovt@ # creates dropin in /etc/systemd/system/getty@.service.d
 $ systemctl cat autovt@ | grep @.service
 # /usr/lib/systemd/system/getty@.service
 # that serial gettys are covered by serial-getty@.service, not this
 # /etc/systemd/system/getty@.service.d/override.conf
 systemctl cat getty@ | grep @.service
 # /usr/lib/systemd/system/getty@.service
 # that serial gettys are covered by serial-getty@.service, not this
 # /etc/systemd/system/getty@.service.d/override.conf
src/systemctl/systemctl.c