Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
Minor tweak to reset script. Needs to create a new PostgreSQL serverl…
Browse files Browse the repository at this point in the history
…og (for startup log) if old one isn't writeable.
  • Loading branch information
dspace committed Aug 13, 2012
1 parent f98d9f5 commit 99393f5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/linux/reset-dspace-content
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ $PGCTL stop -D "$PGDATA" -s -m fast -w
checkerr
echo "ok"
echo ""

# If Postgres Log file isn't writable, delete & recreate
# This sometimes happens with the /etc/init.d script if it creates a log owned by root
if [ ! -w $PGLOG ]; then
# The reason we can force remove this file is that it's under our user directory
rm -f $PGLOG
touch $PGLOG
fi

echo "Starting PostgreSQL: "
# Start Postgres and wait until completely started (-w)
$PGCTL start -D "$PGDATA" -w >>$PGLOG 2>&1
Expand Down

0 comments on commit 99393f5

Please sign in to comment.