Commit 4ecece8f authored by Piotr Gawron's avatar Piotr Gawron
Browse files

fix on upgrade scripts (to deploy new version of minerva)

parent 18bd848f
#file with common script functions for postrm/prerm/postinst/preinst
echo "$@" >>__LOG_FILE__
echo "[" $CURRENT_VERSION "]" "$@" >>__LOG_FILE__
......@@ -14,6 +14,7 @@
# for details, see or
# the debian-policy package
log "Running postinst" $1 $2;
invoke-rc.d $TOMCAT_PACKAGE status >> $LOG_FILE
# we execute it here because if some packages are missing then dpkg will return non-zero exit code
set -e
......@@ -61,8 +62,10 @@ case "$1" in
#we have to restart tomcat, because application was started on the old database and it might crash during deplyment
#for instance in the new war file there was init script that uses some new database features, but they are not
#availble when new war is deployed from debian package, so tomcat will catch SQL exception and stop deployment
invoke-rc.d $TOMCAT_PACKAGE stop || true
rm -rf /var/lib/$TOMCAT_PACKAGE/webapps/minerva
ln -s /usr/share/minerva/minerva.war /var/lib/$TOMCAT_PACKAGE/webapps/minerva.war
invoke-rc.d $TOMCAT_PACKAGE restart
invoke-rc.d $TOMCAT_PACKAGE start
echo "postinst called with unknown argument \`$1'" >&2
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment