From a964b073bfa7552e94fe51f48e18830b1051b0b7 Mon Sep 17 00:00:00 2001 From: Max Dor Date: Wed, 12 Jun 2019 00:18:25 +0200 Subject: [PATCH] Restart mxisd service on Debian package upgrade/install if possible --- build.gradle | 6 ++++++ src/debian/postinst | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/build.gradle b/build.gradle index d2ef3ac..d0fdd12 100644 --- a/build.gradle +++ b/build.gradle @@ -229,6 +229,12 @@ task debBuild(dependsOn: shadowJar) { value: debDataPath ) + ant.replace( + file: "${debBuildDebianPath}/postinst", + token: '%DEB_CONF_FILE%', + value: "${debConfPath}/mxisd.yaml" + ) + ant.chmod( file: "${debBuildDebianPath}/postinst", perm: 'a+x' diff --git a/src/debian/postinst b/src/debian/postinst index 7b06340..b8d9b2b 100755 --- a/src/debian/postinst +++ b/src/debian/postinst @@ -11,3 +11,9 @@ ln -sfT /usr/lib/mxisd/mxisd /usr/bin/mxisd # Enable systemd service systemctl enable mxisd.service + +# If we already have a config file setup, we attempt to run mxisd automatically +# Specifically targeted at upgrades where the service needs to be restarted +if [ -f "%DEB_CONF_FILE%" ]; then + systemctl restart mxisd.service +fi