1) Without the "systemctl show" in preinst, the "systemctl show" in postinst is wrong. Yes, that makes no sense.
Basically, the steps would be:
- systemctl enable anacron.service
- dpkg -i anacron 2.3-33
- (magic step)
- dpkg -i anacron 2.3-36 + my changes
- in postinst, systemctl show anacron.service returns disabled unless "systemctl show anacron.service" is called during (magic step), which could also be in the new anacron's postinst.
TBH, I'm thinking "select isn't broken" but I also feel like I've tried everything and this is the only change. I might also describe this improperly. Maybe there's some cache effect, especially since the whole issue here is related to changing configuration behind systemd's back.
2) I didn't consider doing that, mostly because I changed postinst late. Basically I was debugging and somehow noticed the pattern that results in postinst were right when I was debugging and only when I was debugging. Probing only from preinst could be cleaner and it could also make more sense overall since there would be less opportunities for changes to have happened to the system. I need to look at that and review the exact order in which the package scripts are being run.
I'll see what I can do following your idea in 2). Thanks.
1) Without the "systemctl show" in preinst, the "systemctl show" in postinst is wrong. Yes, that makes no sense.
Basically, the steps would be:
- systemctl enable anacron.service
- dpkg -i anacron 2.3-33
- (magic step)
- dpkg -i anacron 2.3-36 + my changes
- in postinst, systemctl show anacron.service returns disabled unless "systemctl show anacron.service" is called during (magic step), which could also be in the new anacron's postinst.
TBH, I'm thinking "select isn't broken" but I also feel like I've tried everything and this is the only change. I might also describe this improperly. Maybe there's some cache effect, especially since the whole issue here is related to changing configuration behind systemd's back.
2) I didn't consider doing that, mostly because I changed postinst late. Basically I was debugging and somehow noticed the pattern that results in postinst were right when I was debugging and only when I was debugging. Probing only from preinst could be cleaner and it could also make more sense overall since there would be less opportunities for changes to have happened to the system. I need to look at that and review the exact order in which the package scripts are being run.
I'll see what I can do following your idea in 2). Thanks.