On 2016-11-16 21:41, László Böszörményi (GCS) wrote:
> On Wed, Nov 16, 2016 at 4:38 PM, Török Edwin <ed...@skylable.com> wrote:
>> SX 2.3 just got released: http://cdn.skylable.com/source/sx-2.3.tar.gz
>  Thanks for the heads-up!
> 
>> Please let me know if you encounter any problems during packaging.
>  I'm thinking about the best approach of doing the upgrade during the
> package upgrade. I've a test path, but not tried it yet if it works.
> :( Now I first need to update the proposed package to 2.3 first, then
> do the testing.

I tried something like the patch below but I'm not entirely happy with it 
either,
I hope you'll be able to find a better solution.

I had two problems: switching from init scripts to systemd, and having to 
restart SX twice running the upgrade.
Handling the upgrade used to be a lot easier when systemd was not involved.

--- a/server/sxscripts/sbin/sxserver.in 2015-02-13 13:50:32.000000000 +0200
+++ b/server/sxscripts/sbin/sxserver.in 2015-02-13 15:54:09.804283967 +0200
@@ -13,6 +13,12 @@
     echo "No permission to read $CONFIG"
     exit 1
 fi
+if [ "$1" = "oldstop" ]; then
+ set -- "stop"
+elif [ `id -u` -eq 0 -a -x /bin/systemctl ]; then
+       exec /bin/systemctl "$1" sxserver.service
+fi
+

sx.postinst:
....
case "$1" in
    configure)
        # Noop if no upgrade is needed
        if [ -f /etc/sxserver/sxsetup.conf ]; then
            # stop with old init script (the systemd unit for some reason 
doesn't work for stopping a service started by the init script)
            /usr/sbin/sxserver oldstop
            # run upgrade, this leaves the server in running state
            /usr/sbin/sxsetup --upgrade
            # have to stop it again here, cause debhelper scripts below would 
try to start it and fail if its already started.
            /usr/sbin/sxserver stop
        fi
    ;;
.....


Best regards,

Reply via email to