Skip to content
Snippets Groups Projects
Commit a9f420e2 authored by Neil Williams's avatar Neil Williams
Browse files

Fix error in postrm script

parent 32bbc06f
No related branches found
No related tags found
No related merge requests found
lava-server (2017.11-2) unstable; urgency=medium
* Fix error in postrm script
-- Neil Williams <codehelp@debian.org> Sat, 11 Nov 2017 11:26:37 +0000
lava-server (2017.11-1) unstable; urgency=medium
* New production release
......
......@@ -20,8 +20,6 @@ set -e
case "$1" in
purge)
rm -f /etc/lava-server/instance.conf
rm -f /etc/lava-server/secret_key.conf
rm -rf /var/lib/lava-server/home/
rm -rf /var/log/lava-server/
# explicitly not deleting /var/lib/lava-server/default
......@@ -29,20 +27,26 @@ case "$1" in
# Not dropping the database unless there are no job output files.
MEDIADIR="/var/lib/lava-server/default/"
if [ -d $MEDIADIR ]; then
echo "checking ${MEDIADIR}"
if [ ! `mountpoint $MEDIADIR >/dev/null; echo $?` ]; then
# not an sshfs mountpoint, check for only empty directories.
EMPTY=`find $MEDIADIR -type f | grep -v $MEDIADIR/media/.mounted`
if [ "$EMPTY" ]; then
rm -rf $MEDIADIR
echo "Not an SSHFS mountpoint"
EMPTY=`find ${MEDIADIR} -type f | grep -v ${MEDIADIR}/media/.mounted || true`
if [ -z "${EMPTY}" ]; then
echo "Removing ${MEDIADIR}"
rm -rf ${MEDIADIR}
echo "Dropping lavaserver database and user"
sudo su postgres -c "dropdb lavaserver" || true
sudo su postgres -c "dropuser lavaserver" || true
rm -f /etc/lava-server/instance.conf
rm -f /etc/lava-server/secret_key.conf
fi
fi
fi
# Source debconf library.
# Remove my changes to the db.
. /usr/share/debconf/confmodule
db_purge
# . /usr/share/debconf/confmodule
# db_purge
;;
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment