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