diff --git a/conf/etc/service/graphite/run b/conf/etc/service/graphite/run index e4316ec..d647736 100755 --- a/conf/etc/service/graphite/run +++ b/conf/etc/service/graphite/run @@ -24,12 +24,7 @@ export DJANGO_SETTINGS_MODULE=graphite.settings /opt/graphite/bin/django-admin.py makemigrations /opt/graphite/bin/django-admin.py migrate auth /opt/graphite/bin/django-admin.py migrate --run-syncdb -if [ -e "/opt/graphite/storage/graphite.db" ]; then - # if graphite use sqlite database - create superuser - if grep ENGINE /opt/graphite/webapp/graphite/local_settings.py | grep -q django.db.backends.sqlite3; then - /opt/graphite/bin/django_admin_init.exp - fi -fi +/opt/graphite/bin/django_admin_init.sh || true if folder_empty /opt/graphite/webapp/graphite/functions/custom; then touch /opt/graphite/webapp/graphite/functions/custom/__init__.py @@ -42,8 +37,6 @@ export GRAPHITE_WSGI_REQUEST_LINE=${GRAPHITE_WSGI_REQUEST_LINE:-0} export GRAPHITE_WSGI_MAX_REQUESTS=${GRAPHITE_WSGI_MAX_REQUESTS:-1000} export GRAPHITE_WSGI_WORKER_CLASS=${GRAPHITE_WSGI_WORKER_CLASS:-"sync"} export GRAPHITE_WSGI_WORKER_CONNECTIONS=${GRAPHITE_WSGI_WORKER_CONNECTIONS:-1000} -export PYTHONPATH=/opt/graphite/webapp - if [ "${GRAPHITE_WSGI_WORKER_CLASS}" == "gevent" ]; then export GUNICORN_EXTRA_PARAMS="--worker-connections=${GRAPHITE_WSGI_WORKER_CONNECTIONS} " else diff --git a/conf/opt/graphite/bin/django_admin_init.exp b/conf/opt/graphite/bin/django_admin_init.exp deleted file mode 100755 index ea86687..0000000 --- a/conf/opt/graphite/bin/django_admin_init.exp +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env expect - -set timeout -1 -spawn /opt/graphite/bin/django-admin.py createsuperuser - -expect "Username (leave blank to use 'root'):" { - send "root\r" -} - -expect "Email address:" { - send "root.graphite@mailinator.com\r" -} - -expect "Password:" { - send "root\r" -} - -expect "Password *:" { - send "root\r" -} - -expect "Superuser created successfully" diff --git a/conf/opt/graphite/bin/django_admin_init.sh b/conf/opt/graphite/bin/django_admin_init.sh new file mode 100755 index 0000000..efcfbf8 --- /dev/null +++ b/conf/opt/graphite/bin/django_admin_init.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +cat <