From ac23b43e9ff788ef18c1ba1796372f6b4940e788 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 29 Apr 2010 14:29:13 +0300 Subject: [PATCH] init scripts and name --- etc/init/pandora-backgroundtasks.conf | 14 ++++++++++++++ etc/init/pandora-encoder.conf | 14 ++++++++++++++ pandora/bin/pandora-backgroundtasks | 21 +++++++++++++++++++++ pandora/bin/pandora-encoder | 21 +++++++++++++++++++++ pandora/oxuser/templates/contact_email.txt | 4 ++++ wsgi/django.wsgi | 2 +- 6 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 etc/init/pandora-backgroundtasks.conf create mode 100644 etc/init/pandora-encoder.conf create mode 100755 pandora/bin/pandora-backgroundtasks create mode 100755 pandora/bin/pandora-encoder create mode 100644 pandora/oxuser/templates/contact_email.txt diff --git a/etc/init/pandora-backgroundtasks.conf b/etc/init/pandora-backgroundtasks.conf new file mode 100644 index 000000000..cc2955d07 --- /dev/null +++ b/etc/init/pandora-backgroundtasks.conf @@ -0,0 +1,14 @@ +# pandora background server +# + +description "pandora background server" + +start on runlevel [2345] +stop on runlevel [!2345] + +respawn + +chdir /srv/pandora/pandora + +exec /bin/su pandora -s /usr/bin/python2.6 /srv/pandora/pandora/bin/pandora-backgroundtasks + diff --git a/etc/init/pandora-encoder.conf b/etc/init/pandora-encoder.conf new file mode 100644 index 000000000..61d2ccded --- /dev/null +++ b/etc/init/pandora-encoder.conf @@ -0,0 +1,14 @@ +# pandora background server +# + +description "pandora background server" + +start on runlevel [2345] +stop on runlevel [!2345] + +respawn + +chdir /srv/pandora/pandora + +exec /bin/su pandora -s /usr/bin/python2.6 /srv/pandora/pandora/bin/pandora-encoder + diff --git a/pandora/bin/pandora-backgroundtasks b/pandora/bin/pandora-backgroundtasks new file mode 100755 index 000000000..2041410ca --- /dev/null +++ b/pandora/bin/pandora-backgroundtasks @@ -0,0 +1,21 @@ +#!/usr/bin/python +import os +import sys +import site + +project_module = 'pandora' + +root_dir = os.path.normpath(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))) + +#using virtualenv's activate_this.py to reorder sys.path +activate_this = os.path.join(root_dir, 'bin', 'activate_this.py') +execfile(activate_this, dict(__file__=activate_this)) + +sys.path.append(root_dir) +sys.path.append(os.path.join(root_dir, project_module)) + +from django.core.management import execute_manager + +import settings +execute_manager(settings, ['backgroundtasks', 'backgroundtasks']) + diff --git a/pandora/bin/pandora-encoder b/pandora/bin/pandora-encoder new file mode 100755 index 000000000..efd91dc8e --- /dev/null +++ b/pandora/bin/pandora-encoder @@ -0,0 +1,21 @@ +#!/usr/bin/python +import os +import sys +import site + +project_module = 'pandora' + +root_dir = os.path.normpath(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))) + +#using virtualenv's activate_this.py to reorder sys.path +activate_this = os.path.join(root_dir, 'bin', 'activate_this.py') +execfile(activate_this, dict(__file__=activate_this)) + +sys.path.append(root_dir) +sys.path.append(os.path.join(root_dir, project_module)) + +from django.core.management import execute_manager + +import settings +execute_manager(settings, ['pandora-encoder', 'encoder']) + diff --git a/pandora/oxuser/templates/contact_email.txt b/pandora/oxuser/templates/contact_email.txt new file mode 100644 index 000000000..43243d03a --- /dev/null +++ b/pandora/oxuser/templates/contact_email.txt @@ -0,0 +1,4 @@ +Hi {{sitename}} admin, + +someone sent you a message: +{{message}} diff --git a/wsgi/django.wsgi b/wsgi/django.wsgi index 0a06636b1..3ab73e02d 100644 --- a/wsgi/django.wsgi +++ b/wsgi/django.wsgi @@ -3,7 +3,7 @@ import os import sys import site -project_module = 'oxdb' +project_module = 'pandora' root_dir = os.path.normpath(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))