From bcaaec0505f23362076b02cae8608350c486e826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Sun, 15 Nov 2015 12:43:42 +0100 Subject: [PATCH] [fix] Do not rely on dh_installinit and restart service after upgrade --- debian/postinst | 9 +++++++++ debian/rules | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/debian/postinst b/debian/postinst index a45ff75f9..50add893e 100644 --- a/debian/postinst +++ b/debian/postinst @@ -47,6 +47,15 @@ case "$1" in ;; esac +if [ -x /etc/init.d/yunohost-api ]; then + update-rc.d yunohost-api defaults >/dev/null + if [ -d /run/systemd/system ]; then + systemctl --system daemon-reload >/dev/null || true + else + invoke-rc.d yunohost-api start || exit $? + fi +fi + #DEBHELPER# exit 0 diff --git a/debian/rules b/debian/rules index 2208e0623..ebcaefd15 100755 --- a/debian/rules +++ b/debian/rules @@ -8,8 +8,10 @@ dh ${@} --with=python2,systemd override_dh_installinit: - dh_installinit --name=yunohost-api - dh_installinit --name=yunohost-firewall --no-start + dh_installinit --noscripts override_dh_systemd_enable: dh_systemd_enable --name=yunohost-api + +override_dh_systemd_start: + dh_systemd_start --restart-after-upgrade yunohost-api.service