Skip to content

Commit

Permalink
#20 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 b8a638c commit 2cd43f5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ linuxEtcDefaultTemplate in Debian := (baseDirectory.value / "package" / "etc_def
linuxMakeStartScript in Debian := None

// RPM //
rpmRelease := "2"
rpmRelease := "1"
rpmVendor in Rpm := "TheHive Project"
rpmUrl := Some("http://thehive-project.org/")
rpmLicense := Some("AGPL")
Expand Down
26 changes: 20 additions & 6 deletions package/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,26 @@ deleteGroup() {

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

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

addGroup cortex ""
addUser cortex "" cortex "cortex daemon-user" "/bin/false"
# Chown definitions created by SBT Native Packager

chown cortex:cortex /var/log/cortex
chown root:cortex /etc/cortex/application.conf /etc/cortex/logback.xml
chmod 0640 /etc/cortex/application.conf /etc/cortex/logback.xml

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

# Chown definitions created by SBT Native Packager

chown cortex:cortex /var/log/cortex
chown root:cortex /etc/cortex/application.conf /etc/cortex/logback.xml
chmod 0640 /etc/cortex/application.conf /etc/cortex/logback.xml

0 comments on commit 2cd43f5

Please sign in to comment.