Le 03/01/2017 à 13:18, James Page a écrit : > On Tue, 3 Jan 2017 at 12:15 James Page <james.p...@ubuntu.com > <mailto:james.p...@ubuntu.com>> wrote: > > On Tue, 3 Jan 2017 at 11:58 Gustavo Niemeyer > <gustavo.nieme...@canonical.com > <mailto:gustavo.nieme...@canonical.com>> wrote: > > Will systemd handle multiple services with the same name > without complaining? How would it disambiguate? > > We can pull off snap aliases because the binary paths are > separate (not /usr/bin), and thus won't actually conflict even > if system packages and snaps define the same name. > > > I could see how this might be a problem; an Alias can either be > defined in the systemd unit file (in which case systemd will > create an appropriate symlink), or by creating the symlink from > alias->actual in /etc/systemd/system - I'll poke at things and see > how that might break! > > > It would appear that any symlink created in /etc/systemd/system masks > anything provided by a deb package in /lib/systemd/system - so the > glance-api alias from a snap would override the glance-api systemd > unit file provided by a deb package installed on the same system > > I guess this also fits into the general question of how to transition > an existing system from deb->snap in a elegant way as well :-) >
Indeed, systemd has aliases for years, and we should use similarly the Alias keyword in the unit file for those cases. This just create a symlink at the right place and ensure only one unit with this symlink can be enabled at a time. This is how things like display manager, where some alternatives but a fixed service name might be needed (for dependencies) are handled, fyi. Cheers, Didier
-- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft