Open aznhe21 opened 3 months ago
I created the functionality in question. I assume this is either a bug, or a feature of the original debian logic that I copied, but off the top of my head I don't know which, I'm leaning towards bug in my code. I don't know when I'll be able to look at this, I'll see if I can find some time.
It seems that the order of the
systemd-units
changes the result of generating thepostinst
file.This metadata generates
postinst-systemd-dont-enable
basedpostinst
.generated postinst
```sh #!/bin/sh set -e # Automatically added by cargo-deb if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if deb-systemd-helper debian-installed foo.service; then # This will only remove masks created by d-s-h on package removal. deb-systemd-helper unmask foo.service >/dev/null || true if deb-systemd-helper --quiet was-enabled foo.service; then # Create new symlinks, if any. deb-systemd-helper enable foo.service >/dev/null || true fi fi # Update the statefile to add new symlinks (if any), which need to be cleaned # up on purge. Also remove old symlinks. deb-systemd-helper update-state foo.service >/dev/null || true fi # End automatically added section # Automatically added by cargo-deb if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true if [ -n "$2" ]; then deb-systemd-invoke try-restart bar.service foo.service >/dev/null || true fi fi fi # End automatically added section ```This metadata generates
postinst-systemd-enable
basedpostinst
.generated postinst
```sh #!/bin/sh set -e # Automatically added by cargo-deb if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # This will only remove masks created by d-s-h on package removal. deb-systemd-helper unmask foo.service >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled foo.service; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable foo.service >/dev/null || true else # Update the statefile to add new symlinks (if any), which need to be # cleaned up on purge. Also remove old symlinks. deb-systemd-helper update-state foo.service >/dev/null || true fi fi # End automatically added section # Automatically added by cargo-deb if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi deb-systemd-invoke $_dh_action bar.service foo.service >/dev/null || true fi fi # End automatically added section ```