Skip to content

Commit

Permalink
[packaging] Apache reloads instead of restarts, and there is a more a…
Browse files Browse the repository at this point in the history
…ccurate database existence check
  • Loading branch information
thejimmyg committed Dec 16, 2011
1 parent 29e505e commit 906d6bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ckan_deb/usr/bin/ckan-create-instance
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ echo "Bringing the ${INSTANCE} INSTANCE out of maintenance mode ..."
ckan_maintenance_off ${INSTANCE}

# Restart Apache so it is aware of any changes
echo "Restarting apache ..."
/etc/init.d/apache2 restart
echo "Reloading apache ..."
/etc/init.d/apache2 reload

# Install the new crontab
echo "Enabling crontab for the ckan${INSTANCE} user ..."
Expand Down
2 changes: 1 addition & 1 deletion ckan_deb/usr/lib/ckan/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ ckan_ensure_db_exists () {
exit 1
else
INSTANCE=$1
COMMAND_OUTPUT=`sudo -u postgres psql -l`
COMMAND_OUTPUT=`sudo -u postgres psql -c "select datname from pg_database where datname='$INSTANCE'"`
if ! [[ "$COMMAND_OUTPUT" =~ ${INSTANCE} ]] ; then
echo "Creating the database ..."
sudo -u postgres createdb -O ${INSTANCE} ${INSTANCE}
Expand Down

0 comments on commit 906d6bc

Please sign in to comment.