Skip to content

Commit

Permalink
#193 Fix service restart after debian package upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed May 24, 2017
1 parent 67d59c0 commit 867b2b9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ packageBin := {
(packageBin in Rpm).value
}
// DEB //
version in Debian := version.value + "-1"
version in Debian := version.value + "-2"
debianPackageRecommends := Seq("elasticsearch")
debianPackageDependencies += "java8-runtime-headless | java8-runtime"
maintainerScripts in Debian := maintainerScriptsFromDirectory(
Expand Down
30 changes: 23 additions & 7 deletions package/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,29 @@ deleteGroup() {

# #######################################

case "$1" in
configure)
addGroup thehive ""
addUser thehive "" thehive "thehive daemon-user" "/bin/false"

# Chown definitions created by SBT Native Packager

chown thehive:thehive /var/log/thehive
chown root:thehive /etc/thehive/application.conf /etc/thehive/logback.xml
chmod 0640 /etc/thehive/application.conf /etc/thehive/logback.xml
mkdir -p /opt/thehive/conf

test -n "$2" && service thehive start
exit 0
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac


addGroup thehive ""
addUser thehive "" thehive "thehive daemon-user" "/bin/false"

# Chown definitions created by SBT Native Packager

chown thehive:thehive /var/log/thehive
chown root:thehive /etc/thehive/application.conf /etc/thehive/logback.xml
chmod 0640 /etc/thehive/application.conf /etc/thehive/logback.xml
mkdir -p /opt/thehive/conf

0 comments on commit 867b2b9

Please sign in to comment.