FS#50389 - netctl - enable profile directly with `systemctl enable netctl@profilename`

Attached to Project: Arch Linux
Opened by Damian Nowak (Nowaker) - Sunday, 14 August 2016, 00:13 GMT
Last edited by Jouke Witteveen (jouke) - Wednesday, 17 August 2016, 15:10 GMT
Task Type General Gripe
Category Arch Projects
Status Closed
Assigned To Jouke Witteveen (jouke)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

`netctl enable` does this:

ln -s '/etc/systemd/system/netctl@br0.service' '/etc/systemd/system/multi-user.target.wants/netctl@br0.service'

While `systemctl enable` does the same thing:

Created symlink /etc/systemd/system/multi-user.target.wants/redis.service → /usr/lib/systemd/system/redis.service.

Obviously, profile unit needs to be in place before enable call can work via systemctl. But when it's there, there shouldn't be any problem in calling `systemctl disable` directly. However, it doesn't currently work:

root@nwkr-desktop ~ # systemctl enable netctl@br0
The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the [Install] section, and DefaultInstance for template units).
This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
.wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call, ...).
4) In case of template units, the unit is meant to be enabled with some
instance name specified.


Making it work the same as `netctl disable` is as easy as adding this to netctl profile service files:

[Install]
WantedBy=multi-user.target


My suggestion is this section is added to every generated netctl systemd service file. Thanks.
This task depends upon

Closed by  Jouke Witteveen (jouke)
Wednesday, 17 August 2016, 15:10 GMT
Reason for closing:  Won't implement
Additional comments about closing:  `netctl enable` does many more things and `netctl disable` might too (in the future). Profiles should not be enabled/disabled through systemctl.

Loading...