I use debhelper with python setuptools in order to build my packages. I recently updated the compatibility level 9 to 11 in order to use the systemd timers.
From that moment every time I upgrade the package the service contained is restarted. I tried to build with the following rules:
#! /usr/bin/make -f
#export DH_VERBOSE = 1
export PYBUILD_NAME=my_pkg
export DH_ALWAYS_EXCLUDE=CVS:.svn:.git:.vscode*
export PYBUILD_INTERPRETERS=python3
%:
dh $@ --with python3 --buildsystem=pybuild
override_dh_installinit:
dh_installinit --no-stop-on-upgrade --no-restart-on-upgrade --no-restart-after-upgrade --no-start
override_dh_systemd_enable:
dh_systemd_enable --name=my_pkg
override_dh_systemd_start:
dh_systemd_start --no-stop-on-upgrade --no-restart-on-upgrade --no-restart-after-upgrade --no-start
python3 setup.py clean --all
According to the documentation those tags should do what I look for but probably there is something I'm missing:
Every time I update it the service contained is restarted. The service is running the update itself so when is restarted the update is left uncompleted.
As expected I was looking in the wrong direction. The correct option to use is: dh_installsystemd
change the rule file into:
I hope this will help someone else in the same situation.