I see your point about the netplan python seemingly hardcoding [1] the debian pkg’s netman service name so apparently not stopping the service on Core. I look forward to hearing from other folks to see if they agree.
If so, I suppose netplan could check if Core or not and stop the right service name.
Or, I wonder if snapcraft could (or already DOES?) support systemd service alias. If so, perhaps the neetwork-manager snap’s snapcraft.yaml could define the app/daemon with the same name (via alias [1]) as is used in debian env.
[1] line 287 in /usr/sbin/netplan: subprocess.check_call([‘systemctl’, ‘stop’, ‘–no-block’, ‘NetworkManager.service’])
Which includes this:
“Alias=: This directive allows the unit to be enabled under another name as well. Among other uses, this allows multiple providers of a function to be available, so that related units can look for any provider of the common aliased name.”
@kyleN Unfortunately there doesn’t appear to be any support for specifying a systemd service alias in snapcraft (see schema). Snapcraft already has a field called aliases, so this might be confusing, although it’s a good idea and is probably deserves its own post.
I think the best approach for resolving this bug would be to file a bug against netplan, and then create a patch and associate with the bug. That said, getting this into 16.04 would require an SRU (which shouldn’t be too difficult as netplan lives in universe).
Well, Netplan is not in the wrong here, since NetworkManager.service is the upstream service name. It’s contorted in Debian/Ubuntu to network-manager.service. If Netplan is getting patched, it should only be downstream in Ubuntu.
@Conan_Kudo This isn’t an issue between network-manager.service (which looks to be from pre 0.9.8-4 Debian package) and the newer NeworkManager.service file, it’s that netplan is being run on an Ubuntu Core 16 image where NetworkManager is being provided by a snap, which also results in a non-matching service name, snap.network-manager.networkmanager.service.
As @kyleN pointed out, if snapd/snapcraft grew support for systemd’s service unit Alias field, this could be easily solved. We’ll raise this with the snapd team, as this may impact the ability of other well-known services to be deployed as snaps.
Re: only patching this in the downstream Ubuntu package(s), yes that makes sense.