Fixes to the process_fts_updates

Added nginx.conf for supervisord
This commit is contained in:
Alexander Trost
2015-10-18 01:26:58 +02:00
parent 2339075d38
commit c9be5868d3
5 changed files with 32 additions and 3 deletions

View File

@@ -20,6 +20,22 @@ rabbitmqSetup(){
rabbitmqctl set_permissions -p / zulip '.*' '.*' '.*' || :
}
databaseSetup(){
if [ -z "$DB_HOST" ]; then
echo "No DB_HOST given."
exit 2
fi
if [ -z "$DB_NAME" ]; then
echo "No DB_NAME given."
exit 2
fi
if [ -z "$DB_USER" ]; then
echo "No DB_USER given."
exit 2
fi
if [ -z "$DB_PASSWORD" ]; then
echo "No DB_PASSWORD given."
exit 2
fi
cat >> "$ZULIP_ZPROJECT_SETTINGS" <<EOF
from zerver.lib.db import TimeTrackingConnection
@@ -59,6 +75,7 @@ EOF
echo -n "."
sleep 1
done
sed -i "s~psycopg2.connect(\"user=zulip\")~psycopg2.connect(\"host=$DB_HOST port=$DB_PORT dbname=$DB_NAME user=$DB_USER password=$DB_PASSWORD\")~g" "/usr/local/bin/process_fts_updates"
echo """
CREATE USER zulip;
ALTER ROLE zulip SET search_path TO zulip,public;

View File

@@ -51,4 +51,3 @@ while True:
while conn.notifies:
conn.notifies.pop()
update_fts_columns(cursor)

View File

@@ -1,5 +1,5 @@
[program:cron]
command = /usr/sbin/cron -f
stdout_logfile = /var/log/supervisor/%(program_name)s.log
stderr_logfile = /var/log/supervisor/%(program_name)s.log
stdout_events_enabled=true
stderr_events_enabled=true
autorestart = true

View File

@@ -0,0 +1,5 @@
[program:cron]
command = /usr/sbin/nginx
stdout_events_enabled=true
stderr_events_enabled=true
autorestart = true

View File

@@ -30,4 +30,12 @@ class zulip::nginx {
file { "/etc/nginx/sites-enabled/default":
ensure => absent,
}
file { "/etc/supervisor/conf.d/nginx.conf":
require => Package[supervisor],
ensure => file,
owner => "root",
group => "root",
mode => 644,
source => "puppet:///modules/zulip/supervisor/conf.d/nginx.conf",
}
}