On Wed, 17 Aug 2016 12:35, Kristoffer Grönlund wrote:
Yamaban writes:
On Wed, 17 Aug 2016 12:09, Marcus Meissner wrote:
Hi,
Is there a systemd way to migrate service files and keep enabled state?
E.g. We are planning a hawk -> hawk2 migration and would like to transfer the hawk enabled state to hawk2.
(Or use something like systemctl status hawk.service || systemctl enable hawk2.service or so)
The following works, but is not ideal:
in spec-file, before uninstaling hawk, after installing hawk2:
systemctl is-enabled hawk.service && systemctl enable hawk2.service
be aware of "--root=PATH", it may be needed
The description of the problem is not quite right: We've dropped the hawk package in favor of the hawk2 package (they were co-existing at the same time for a while, but hawk 1 is outdated now). They both provide the hawk systemd service.
So a user upgrading will get moved to the hawk2 package, but if the hawk service was enabled before the upgrade, it is now disabled.
Eh? hawk1 provides hawk.service, by your words hawk2 ALSO provides hawk.service (so the enable/mask sym-links are kept, no fuss at all) IF you REALLY want a coexistence go the way of the displaymanager.service hawk1 shall provide hawk1.service, hawk2 shall provide hawk2.service, "hawk" meta package provides hawk.service to switch between hawk1 and hawk2 Or go the way of a message similar to "Adobe-Flash Liciense" with the info for the user to do the re-eablement themselfs. - Yamaban