Add a service to restart python3-validity on suspend/resume. Thanks to @flops

This commit is contained in:
Viktor Dragomiretskyy 2020-07-17 00:23:30 +12:00
parent 81791030e8
commit 504f5316b5
4 changed files with 17 additions and 6 deletions

3
.gitignore vendored
View file

@ -2,9 +2,8 @@ debian/tmp/
debian/debhelper-build-stamp
debian/python3-validity/
debian/python3-validity.substvars
debian/python3-validity.prerm.debhelper
debian/python3-validity.postinst.debhelper
debian/files
debian/*.debhelper
debian/.debhelper/
__pycache__

View file

@ -0,0 +1,11 @@
[Unit]
Description=Restart python-validity after resume
After=suspend.target hibernate.target
[Service]
Type=simple
ExecStart=/bin/systemctl --no-block restart python3-validity.service
[Install]
WantedBy=suspend.target hibernate.target

View file

@ -2,9 +2,9 @@
set -e
if [ -x "/usr/bin/deb-systemd-invoke" ] && [ "$1" = remove ]; then
deb-systemd-invoke stop 'python3-validity.service' || true
fi
#if [ -x "/usr/bin/deb-systemd-invoke" ] && [ "$1" = remove ]; then
# deb-systemd-invoke stop 'python3-validity.service' || true
#fi
#DEBHELPER#

3
debian/rules vendored
View file

@ -6,7 +6,8 @@
dh $@ --with python3 --buildsystem=pybuild
override_dh_installsystemd:
dh_installsystemd
dh_installsystemd --name=python3-validity
dh_installsystemd --name=python3-validity-suspend-restart
override_dh_auto_install: