[ckan-changes] commit/ckan-debs-public: jame... at okfn.org: Fixes from the test run
Bitbucket
commits-noreply at bitbucket.org
Wed Jun 15 15:29:37 UTC 2011
1 new changeset in ckan-debs-public:
http://bitbucket.org/okfn/ckan-debs-public/changeset/3227364923f6/
changeset: 3227364923f6
user: jame... at okfn.org
date: 2011-06-15 17:29:41
summary: Fixes from the test run
affected #: 1 file (15 bytes)
--- a/ckan-common/usr/lib/ckan/common.sh Wed Jun 15 12:08:27 2011 +0100
+++ b/ckan-common/usr/lib/ckan/common.sh Wed Jun 15 15:29:41 2011 +0000
@@ -1,24 +1,24 @@
#!/bin/bash
-log () {
- echo "ckan: hello" $1
+ckan_log () {
+ echo "ckan: " $1
}
#_echo="echo"
ckan_maintenance_on () {
local INSTANCE
INSTANCE=$1
- $_echo a2dissite ${INSTANCE} &> /dev/null
- $_echo a2ensite ${INSTANCE}.maint &> /dev/null
- $_echo service apache2 reload &> /dev/null
+ $_echo a2dissite ${INSTANCE}
+ $_echo a2ensite ${INSTANCE}.maint
+ $_echo service apache2 reload
}
ckan_maintenance_off () {
local INSTANCE
INSTANCE=$1
- $_echo a2dissite ${INSTANCE}.maint &> /dev/null
- $_echo a2ensite ${INSTANCE} &> /dev/null
- $_echo service apache2 reload &> /dev/null
+ $_echo a2dissite ${INSTANCE}.maint
+ $_echo a2ensite ${INSTANCE}
+ $_echo service apache2 reload
}
ckan_set_log_file_permissions () {
@@ -44,7 +44,6 @@
if ! [[ "$COMMAND_OUTPUT" =~ "ckan${INSTANCE}:" ]] ; then
echo "Crating the 'ckan${INSTANCE}' user ..."
sudo useradd --system --gid "ckan${INSTANCE}" --home /var/lib/ckan/${INSTANCE} -M --shell /usr/sbin/nologin ckan${INSTANCE}
- sudo usermod -a -G www-data ckan${INSTANCE}
fi
}
@@ -57,8 +56,8 @@
else
INSTANCE=$1
mkdir -p -m 0755 /etc/ckan/${INSTANCE}
- mkdir -p -m 2750 /var/lib/ckan/${INSTANCE}{,/static}
- mkdir -p -m 2770 /var/{backup,log}/ckan/${INSTANCE} /var/lib/ckan/${INSTANCE}/{data,sstore,static/dump}
+ mkdir -p -m 0750 /var/lib/ckan/${INSTANCE}{,/static}
+ mkdir -p -m 0770 /var/{backup,log}/ckan/${INSTANCE} /var/lib/ckan/${INSTANCE}/{data,sstore,static/dump}
chgrp ckan${INSTANCE} /var/lib/ckan/${INSTANCE}
chgrp ckan${INSTANCE} /var/backup/ckan/${INSTANCE}
chgrp ckan${INSTANCE} /var/log/ckan/${INSTANCE}
@@ -98,7 +97,7 @@
-e "s,^\(error_email_from\)[ =].*,\1 = ckan-${INSTANCE}@`hostname`," \
-e "s,^\(cache_dir\)[ =].*,\1 = /var/lib/ckan/${INSTANCE}/data," \
-e "s,^\(who.config_file\)[ =].*,\1 = /etc/ckan/${INSTANCE}/who.ini," \
- -e "s,%(here)s,/var/lib/ckan/${INSTANCE}," \
+ -e "s,%(here)s/ckan.log,/var/log/ckan/${INSTANCE}/${INSTANCE}.log," \
-e "s,^\(sqlalchemy.url\)[ =].*,\1 = postgresql://${INSTANCE}:${password}@localhost/${INSTANCE}," \
-i /etc/ckan/${INSTANCE}/${INSTANCE}.ini
fi
@@ -116,11 +115,13 @@
else
INSTANCE=$1
password=$2
- COMMAND_OUTPUT=`sudo -u postgres psql -c "SELECT 'True' FROM pg_user WHERE usename='${INSTANCE}'" 2> /dev/null`
+ COMMAND_OUTPUT=`sudo -u postgres psql -c "SELECT 'True' FROM pg_user WHERE usename='${INSTANCE}'"`
if ! [[ "$COMMAND_OUTPUT" =~ True ]] ; then
- sudo -u postgres -c "psql -c \"CREATE USER \"${INSTANCE}\" WITH PASSWORD '${password}'\""
+ echo "Creating the ${INSTANCE} user ..."
+ sudo -u postgres psql -c "CREATE USER \"${INSTANCE}\" WITH PASSWORD '${password}'"
else
- sudo -u postgres -c "psql -c \"ALTER USER \"${INSTANCE}\" WITH PASSWORD '${password}'\""
+ echo "Setting the ${INSTANCE} user password ..."
+ sudo -u postgres psql -c "ALTER USER \"${INSTANCE}\" WITH PASSWORD '${password}'"
fi
fi
}
@@ -167,7 +168,7 @@
INSTANCE=$1
ServerName=$2
ServerAlias=$3
- rm /etc/apache2/sites-available/${INSTANCE}.common
+ #rm /etc/apache2/sites-available/${INSTANCE}.common
cat <<EOF > /etc/apache2/sites-available/${INSTANCE}.common
# WARNING: Do not manually edit this file, it is desgined to be
@@ -209,7 +210,7 @@
ErrorLog /var/log/apache2/${INSTANCE}.error.log
CustomLog /var/log/apache2/${INSTANCE}.custom.log combined
EOF
- rm /etc/apache2/sites-available/${INSTANCE}
+ #rm /etc/apache2/sites-available/${INSTANCE}
cat <<EOF > /etc/apache2/sites-available/${INSTANCE}
<VirtualHost *:80>
# WARNING: Do not manually edit this file, it is desgined to be
@@ -218,7 +219,7 @@
Include /etc/apache2/sites-available/${INSTANCE}.common
</VirtualHost>
EOF
- rm /etc/apache2/sites-available/${INSTANCE}.maint
+ #rm /etc/apache2/sites-available/${INSTANCE}.maint
cat <<EOF > /etc/apache2/sites-available/${INSTANCE}.maint
<VirtualHost *:80>
# WARNING: Do not manually edit this file, it is desgined to be
Repository URL: https://bitbucket.org/okfn/ckan-debs-public/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the ckan-changes
mailing list