Lennart Poettering wrote on 05/12/14 13:52:
>> > Only preinst can (getting the "install" or "upgrade" argument), not 
>> > postinst
>> > (getting "configure" in both case). And we need to run the preset/enable in
>> > postinst (meaning: after unpacking).
> This sounds quite a limitation. Maybe you can keep a couple of touch files
> in /var/lib/ somewhere where you store whether you already applied
> "systemctl preset" before?

For what it's worth, this is the technique I used when migrating
sysvinit -> native units.

For a while, we had both sysvinit script and systemd units shipped in
the same package (to allow a choice of init system - but we dropped
support for sysvinit ages ago - in fact the last distro version that
supported this went EOL the other day!).

When the systemd unit was first introduced in the package (assuming the
user was upgrading) we would migrate the enablement state of the
sysvinit script to the systemd unit - if sysvinit was enabled, then so
should the systemd unit; if it was disabled then so should the systemd
unit. We only did this the first time the systemd unit showed up in the
package and touched a file in /var/lib to track this. After this initial
transition, their enablement state (whether it be sysvinit or native)
was in the hands of the admin.

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to