Skip to content

Commit

Permalink
Restart mxisd service on Debian package upgrade/install if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
maxidorius committed Jun 11, 2019
1 parent f85345b commit a964b07
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 6 additions & 0 deletions src/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a964b07

Please sign in to comment.