systemctl: allow disable on the unit file path, but warn about it (#3806)
authorMichal Sekletar <msekletar@users.noreply.github.com>
Tue, 26 Jul 2016 12:25:52 +0000 (14:25 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 26 Jul 2016 12:25:52 +0000 (08:25 -0400)
commit1d3c86c06fca8311923fcf81af0ab0bbb66e1edd
treeb31f5a6b5fc1e9564844ef663b6f4e4c55d149f5
parent76153ad45f09b6ae45464f2e03d3afefbb4b2afe
systemctl: allow disable on the unit file path, but warn about it (#3806)

systemd now returns an error when it is asked to perform disable on the
unit file path. In the past this was allowed, but systemd never really
considered an actual content of the [Install] section of the unit
file. Instead it performed disable on the unit name, i.e. purged all
symlinks pointing to the given unit file (undo of implicit link action
done by systemd when enable is called on the unit file path) and all
symlinks that have the same basename as the given unit file.

However, to notice that [Install] info of the file is not consulted one
must create additional symlinks manually. I argue that in most cases
users do not create such links. Let's be nice to our users and don't
break existing scripts that expect disable to work with the unit file
path.

Fixes #3706.
src/systemctl/systemctl.c