Browse files

Minor tweak to reset script. Needs to create a new PostgreSQL serverl…

…og (for startup log) if old one isn't writeable.
  • Loading branch information...
1 parent f98d9f5 commit 99393f53334b5f5e7eed2fe397572c46fa302c88 dspace committed Aug 13, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 scripts/linux/reset-dspace-content
@@ -119,6 +119,15 @@ $PGCTL stop -D "$PGDATA" -s -m fast -w
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
echo "Starting PostgreSQL: "
# Start Postgres and wait until completely started (-w)
$PGCTL start -D "$PGDATA" -w >>$PGLOG 2>&1

0 comments on commit 99393f5

Please sign in to comment.