modif du système de démarrage et des divers scripts en général, un fichier

glasnost-ctl en python qui fait tout, mieux.
This commit is contained in:
fpeters 2003-09-28 16:21:09 +00:00
parent d1a93ff682
commit 4b45ea5a56
15 changed files with 314 additions and 605 deletions

125
Makefile
View File

@ -37,7 +37,6 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
NAME=glasnost
#check if exist in glasnost-variables-filename
RELEASE_TYPE=-devel
RPM_RELEASE=1
GLASNOST=$(NAME)$(RELEASE_TYPE)
@ -45,17 +44,8 @@ PORT=9000
VERSION=20030716
GLASNOST_MODULE= $(subst -,_,$(GLASNOST))
GROUP_ID=`id -gn ${LOGNAME}`
LANGUAGES=de es fi fr sv
PYTHON_VERSION=2.1
USER_ID=$(LOGNAME)
TESTS_SUITE = suites
# Prefixes
# PREFIX=/opt/$(GLASNOST)
# VARPREFIX=/var/lib
# SHAREPREFIX=$(PREFIX)/share
# LOGPREFIX=/var/log
PREFIX=/usr/local
PREFIX_QUOTED=$(subst /,\/,$(PREFIX))
@ -106,7 +96,7 @@ TEMPLATES=default april bxlug codelutin.org cuisine easter-eggs entrouvert.com e
RPM_PACKAGE_NAME=python$(PYTHON_VERSION)-tal python$(PYTHON_VERSION)-imaging python$(PYTHON_VERSION)-docutils
.PHONY: $(GLASNOST)-variables help archive clean data-archive dist dist-clean install-create-dir install-glasnost install-data install-extensions install-gtk install-locale install-log install-python-libs install-scripts install-servers install-templates install-tests install-web install mo po glasnost.spec rpm rpm-depend run-tests system tests uninstall-tests uninstall
.PHONY: help archive clean data-archive dist dist-clean install-create-dir install-glasnost install-data install-extensions install-gtk install-locale install-log install-python-libs install-scripts install-servers install-templates install-web install mo po glasnost.spec rpm rpm-depend uninstall
help:
@echo
@ -197,20 +187,8 @@ dist-clean:
$(FIND) . -name ".#*" | xargs -r rm
$(FIND) . -name ".nautilus-metafile.xml" | xargs -r rm
$(FIND) . -name "nohup.out" | xargs -r rm
$(FIND) ./templates/ -name '*.talc.*' -or -name '*.htmlc.*' | xargs -r rm
-rm -f config
-rm -f $(GLASNOST)-variables
$(GLASNOST)-variables: glasnost-variables.in
cat $^ | \
sed -e "s/^SERVERSDIR=.*/SERVERSDIR=\"$(SERVERS_DIR_QUOTED)\"/g" \
| sed -e "s/^PYTHON=.*/PYTHON=python$(PYTHON_VERSION)/g" \
> $@
$(GLASNOST)-%: glasnost-%.in
cat $^ | \
sed -e "s/^SERVERSDIR=.*/SERVERSDIR=\"$(SERVERS_DIR_QUOTED)\"/g" \
| sed -e "s/^PYTHON=.*/PYTHON=python$(PYTHON_VERSION)/g" \
> $@
install-create-dir:
-mkdir -p "$(DESTDIR)/$(BIN_DIR)"
@ -230,13 +208,7 @@ install-create-dir:
-mkdir -p "$(DESTDIR)/$(WEB_DIR)"
install-glasnost: config \
$(GLASNOST)-variables \
glasnost-variables-filename \
glasnost-convert-ids \
glasnost-export \
glasnost-import \
glasnost-make-system \
glasnost-start
glasnost-ctl.py
@mkdir -p "$(DESTDIR)/$(GLASNOST_DIR)"
-cp $^ "$(DESTDIR)/$(GLASNOST_DIR)"/
@if test -e "$(DESTDIR)/$(SBIN_DIR)/$(GLASNOST)"; then \
@ -247,24 +219,14 @@ install-glasnost: config \
else \
RPM_DESTDIR=="$(DESTDIR)"; \
fi
-ln -sb "$(RPM_DESTDIR)/$(GLASNOST_DIR)/glasnost-variables-filename" \
"$(DESTDIR)/$(SBIN_DIR)/glasnost-variables-filename"
-ln -sb "$(RPM_DESTDIR)/$(GLASNOST_DIR)/$(GLASNOST)-variables" \
"$(DESTDIR)/$(SBIN_DIR)/$(GLASNOST)-variables"
-ln -sb "$(RPM_DESTDIR)/$(GLASNOST_DIR)/glasnost-convert-ids" \
"$(DESTDIR)/$(SBIN_DIR)/$(GLASNOST)-convert-ids"
-ln -sb "$(RPM_DESTDIR)/$(GLASNOST_DIR)/glasnost-export" \
"$(DESTDIR)/$(SBIN_DIR)/$(GLASNOST)-export"
-ln -sb "$(RPM_DESTDIR)/$(GLASNOST_DIR)/glasnost-import" \
"$(DESTDIR)/$(SBIN_DIR)/$(GLASNOST)-import"
-ln -sb "$(RPM_DESTDIR)/$(GLASNOST_DIR)/glasnost-make-system" \
"$(DESTDIR)/$(SBIN_DIR)/$(GLASNOST)-make-system"
-ln -sb "$(RPM_DESTDIR)/$(GLASNOST_DIR)/glasnost-start" \
"$(DESTDIR)/$(SBIN_DIR)/$(GLASNOST)"
cat glasnost-ctl.py | sed -e "s/^glasnostPythonDir = .*/glasnostPythonDir = \"$(LIBS_DIR_QUOTED)\"/g" > "$(DESTDIR)/$(SBIN_DIR)/$(GLASNOST)-ctl"
chmod +x "$(DESTDIR)/$(SBIN_DIR)/$(GLASNOST)-ctl"
@if ! test -e "$(DESTDIR)/$(ETC_DIR)"; then \
mkdir -p "$(DESTDIR)/$(ETC_DIR)"; \
else :; fi
-cp "$(DESTDIR)/$(ETC_DIR)/config" "$(DESTDIR)/$(ETC_DIR)/config.save"
test ! -e "$(DESTDIR)/$(ETC_DIR)/config" || \
cp "$(DESTDIR)/$(ETC_DIR)/config" "$(DESTDIR)/$(ETC_DIR)/config.save"
test -e "$(DESTDIR)/$(ETC_DIR)/config" || cp config "$(DESTDIR)/$(ETC_DIR)/config"
install-data:
@ -309,6 +271,7 @@ install-python-libs:
-cp -R shared/* "$(DESTDIR)/$(PYTHON_DIR)"
cat shared/__init__.py | \
sed -e "s/applicationName = .*/applicationName = '$(GLASNOST)'/" \
-e "s/serverUser = .*/serverUser = '$(SERVER_USER)'/" \
-e "s/versionNumber = .*/versionNumber = '$(VERSION)'/" > "$(DESTDIR)/$(PYTHON_DIR)/__init__.py"
cat shared/common/tools_new.py | \
sed -e "s/^configFile.*/configFile = \"$(ETC_DIR_QUOTED)\/config\"/g" > "$(DESTDIR)/$(PYTHON_DIR)/common/tools_new.py"
@ -340,19 +303,6 @@ install-templates:
cp -R templates/$$F "$(DESTDIR)/$(TEMPLATES_DIR)"/; \
done
install-tests:
@echo "Cleaning..."
@$(MAKE) GLASNOST=glasnost-tests PORT=8500 dist-clean
#@echo "Installing/Updating /etc/hosts entries"
#@grep /etc/hosts -e "127.0.0.1 glasnost-test" -q && cat /etc/hosts | sed -e "s/^127.0.0.1 glasnost-test.*/127.0.0.1 glasnost-test1 glasnost-test2 glasnost-test3/g" > /tmp/hosts-tmp || echo "127.0.0.1 glasnost-test1 glasnost-test2 glasnost-test3" >> /etc/hosts
#@test -e /tmp/hosts-tmp && mv /tmp/hosts-tmp /etc/hosts
# @echo "Installing/Updating config Dispacher URLs entries"
# @cat config | sed -e "s/^DispatcherURLs.*/DispatcherURLs = glasnost:\/\/glasnost-test1, glasnost:\/\/glasnost-test2, glasnost:\/\/glasnost-test3/g" > config.tmp
# @mv config.tmp config
@echo "Setting up the tests tree"
@$(MAKE) GLASNOST=glasnost-tests PORT=8500 config-tests
@$(MAKE) GLASNOST=glasnost-tests PORT=8500 install
install-web:
-mkdir -p "$(DESTDIR)/$(WEB_DIR)"
-cp glasnost-web/.htaccess "$(DESTDIR)/$(WEB_DIR)"/
@ -439,50 +389,6 @@ rpm-depend:
(cd redhat; alien --keep-version --to-rpm /var/cache/apt/archives/$$PACKAGE_NAME); \
done
run-tests:
@echo "Launching tests..."
cd tmp-tests && ./launch.py $(TESTS_SUITE)
setup-tests:
@echo "Launching Glasnost Test environment..."
"$(SBIN_DIR)/glasnost-tests" stop
"$(SBIN_DIR)/glasnost-tests" start
system:
@echo "Stopping server for system generation..."
"$(SBIN_DIR)/glasnost-system" stop || /bin/true
@echo "Uninstalling server for system generation..."
@$(MAKE) GLASNOST=glasnost-system PORT=8600 uninstall
@ echo "Erasing system generation data..."
-rm -rf "$(VARPREFIX)/glasnost-system"
@$(MAKE) GLASNOST=glasnost-system PORT=8600 dist-clean
@echo "Configuring files for system generation..."
@$(MAKE) GLASNOST=glasnost-system PORT=8600 config-system
@echo "Installing server for system generation..."
@$(MAKE) GLASNOST=glasnost-system PORT=8600 install
@echo "Starting server for system generation..."
"$(SBIN_DIR)/glasnost-system" start
@echo "Generating system..."
cd tmp-system && ./generate-system.py
@echo "Converting to real system..."
"$(SBIN_DIR)/glasnost-system-make-system" localhost
@echo "Stopping server for system generation..."
"$(SBIN_DIR)/glasnost-system" stop
@echo "Copying system data into system/data..."
rm -rf system/data
cp -pr "$(VARPREFIX)/glasnost-system/system" system/data
$(FIND) system/data -type d -exec chmod 755 {} \;
$(FIND) system/data -type f -exec chmod 644 {} \;
@echo "Uninstalling server for system generation..."
@$(MAKE) GLASNOST=glasnost-system PORT=8600 uninstall
@ echo "Erasing system generation data..."
rm -rf "$(VARPREFIX)/glasnost-system"
tests: uninstall-tests \
install-tests \
setup-tests \
run-tests
uninstall:
-rm -Rf "$(DESTDIR)/$(GLASNOST_DIR)"
-rm -Rf "$(DESTDIR)/$(LOG_DIR)"
@ -490,18 +396,7 @@ uninstall:
-rm -Rf "$(DESTDIR)/$(LIBS_DIR)"
-rm -Rf "$(DESTDIR)/$(SERVERS_DIR)"
-rm -f "$(DESTDIR)/etc/init.d/$(GLASNOST)"
-rm -f "$(DESTDIR)/$(SBIN_DIR)/$(GLASNOST)"
-rm -f "$(DESTDIR)/$(SBIN_DIR)/$(GLASNOST)-variables"
-rm -f "$(DESTDIR)/$(SBIN_DIR)/glasnost-variables-filename"
-rm -f "$(DESTDIR)/$(SBIN_DIR)/$(GLASNOST)-convert-ids"
-rm -f "$(DESTDIR)/$(SBIN_DIR)/$(GLASNOST)-export"
-rm -f "$(DESTDIR)/$(SBIN_DIR)/$(GLASNOST)-import"
-rm -f "$(DESTDIR)/$(SBIN_DIR)/$(GLASNOST)-make-system"
-rm -f "$(DESTDIR)/$(SBIN_DIR)/$(GLASNOST)-ctl"
$(FIND) "$(LOCALE_DIR)" -name "$(GLASNOST)-web.mo" -exec rm {} \; \
|| /bin/true
uninstall-tests:
@glasnost-tests stop || exit 0
@$(MAKE) GLASNOST=glasnost-tests PORT=8500 uninstall
rm -rf "$(VARDIR)/glasnost-tests"

View File

@ -1,5 +1,5 @@
glasnost for Debian
-----------------
Glasnost for Debian
-------------------
You should modify your apache configuration to include something like:
(and activate libapache-mod-python)

98
debian/changelog vendored
View File

@ -1,8 +1,102 @@
glasnost (0.6.999.cvs-latestCVS.20030831.1) unstable; urgency=low
glasnost (0.6.999.cvs-latestCVS.20030926.1) unstable; urgency=low
* Built locally from CVS.
-- Frederic Peters <fpeters@debian.org> Mon, 30 Jun 2003 18:30:44 +0200
-- Frederic Peters <fpeters@debian.org> Fri, 26 Sep 2003 19:04:38 +0200
glasnost (0.6.5-1) unstable; urgency=low
* New upstream release (the "Pacification" release)
-- Frederic Peters <fpeters@debian.org> Mon, 8 Sep 2003 14:33:50 +0200
glasnost (0.6.4-5) unstable; urgency=low
* shared/proxy/PeopleProxy.py: fixed addObject
-- Frederic Peters <fpeters@debian.org> Wed, 3 Sep 2003 19:42:01 +0200
glasnost (0.6.4-4) unstable; urgency=low
* Updated Spanish translation
* Fixed inline tags detection.
* Fixed rare error case in TranslationsServer.
-- Frederic Peters <fpeters@debian.org> Mon, 1 Sep 2003 18:55:27 +0200
glasnost (0.6.4-3) unstable; urgency=low
* shared/web/widgets.py: added back bad code as it has been corrected.
* moved templates files (images, css) to templates/*/web/
* export webTools module for the TAL API
* other things I forgot.
-- Frederic Peters <fpeters@debian.org> Sat, 30 Aug 2003 11:34:33 +0200
glasnost (0.6.4-2) unstable; urgency=low
* shared/web/widgets.py: removed bad code that didn't work and broke the
full list view in SelectId widget.
-- Frederic Peters <fpeters@debian.org> Mon, 25 Aug 2003 17:35:43 +0200
glasnost (0.6.4-1) unstable; urgency=low
* New upstream release (the "Climbing Cranes" release)
-- Frederic Peters <fpeters@debian.org> Sat, 23 Aug 2003 20:41:25 +0200
glasnost (0.6.3-9) unstable; urgency=low
* shared/web/tools.py: fixed TAL file lookup
-- Frederic Peters <fpeters@debian.org> Fri, 22 Aug 2003 18:23:16 +0200
glasnost (0.6.3-8) unstable; urgency=low
* updated translations
-- Frederic Peters <fpeters@debian.org> Thu, 21 Aug 2003 21:52:55 +0200
glasnost (0.6.3-7) unstable; urgency=low
* shared/web/tools.py: backport getUrlId()
* misc other backports
-- Frederic Peters <fpeters@debian.org> Wed, 20 Aug 2003 22:04:32 +0200
glasnost (0.6.3-6) unstable; urgency=low
* shared/web/kinds.py: correction de plus de caractères étrangers
* shared/web/widgets.py: tri des items d'un SelectId
-- Frederic Peters <fpeters@debian.org> Tue, 12 Aug 2003 00:37:02 +0200
glasnost (0.6.3-5) unstable; urgency=low
* shared/web/widgets.py: classe 'error' sur la ligne
* glasnost-web/code/webhandler.py: backport gestion traductions
* shared/web/kinds.py: correction apostrophes
-- Frederic Peters <fpeters@debian.org> Sun, 27 Jul 2003 14:50:46 +0200
glasnost (0.6.3-4) unstable; urgency=low
* glasnost-web/search.py: fixed search form
-- Frederic Peters <fpeters@debian.org> Tue, 15 Jul 2003 19:41:06 +0200
glasnost (0.6.3-3) unstable; urgency=low
* shared/server/xmlrpcServer.py: fix SSL support for the gateway
-- Frederic Peters <fpeters@debian.org> Tue, 1 Jul 2003 11:59:20 +0200
glasnost (0.6.3-2) unstable; urgency=low
* debian/postinst: correctly create missing directories.
-- Frederic Peters <fpeters@debian.org> Mon, 30 Jun 2003 22:16:28 +0200
glasnost (0.6.3-1) unstable; urgency=low

44
debian/glasnost.init vendored
View File

@ -4,34 +4,15 @@
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="glasnost"
NAME="glasnost"
DIR=/usr/lib/glasnost/
#set -e
case "$1" in
start)
echo -n "Starting $DESC: "
for SERV in Dispatcher VirtualHostsServer Gateway
do
start-stop-daemon --chuid glasnost \
--start --exec $DIR/servers/$SERV/$SERV.py
echo -n '.'
sleep 5
done
for SERV in `ls $DIR/servers/ | egrep -v 'Dispatcher|Gateway|VirtualHosts'`
do
grep -q "^\[$SERV\]$" /etc/glasnost/config && \
start-stop-daemon --chuid glasnost \
--start --exec $DIR/servers/$SERV/$SERV.py && \
echo -n '.'
done
echo " done."
glasnost-ctl start
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --user glasnost || true
echo "done."
glasnost-ctl stop
;;
restart|force-reload)
#
@ -40,24 +21,9 @@ case "$1" in
# just the same as "restart".
#
echo -n "Restarting $DESC (this takes time): "
start-stop-daemon --stop --user glasnost || true
sleep 20
for SERV in Dispatcher VirtualHostsServer Gateway
do
start-stop-daemon --chuid glasnost \
--start --exec $DIR/servers/$SERV/$SERV.py
echo -n '.'
sleep 5
done
for SERV in `ls $DIR/servers/ | egrep -v 'Dispatcher|Gateway|VirtualHosts'`
do
start-stop-daemon --chuid glasnost \
--start --exec $DIR/servers/$SERV/$SERV.py
echo -n '.'
done
glasnost-ctl stop > /dev/null
sleep 10
glasnost-ctl start > /dev/null
echo " done."
;;
reload)

13
debian/glasnost.logrotate vendored Normal file
View File

@ -0,0 +1,13 @@
/var/log/glasnost/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 640 glasnost adm
sharedscripts
postrotate
glasnost-ctl logrotate > /dev/null
endscript
}

View File

@ -57,5 +57,7 @@ chown -R $GLASNOST_USER /var/log/glasnost/
test -d /var/lib/glasnost/webcache || mkdir /var/lib/glasnost/webcache
chown www-data.www-data /var/lib/glasnost/webcache/
/usr/sbin/glasnost-ctl compile-tal
#DEBHELPER#

2
debian/rules vendored
View File

@ -56,7 +56,7 @@ install: build
dh_installdirs
# Add here commands to install the package into debian/glasnost.
$(MAKE) install DESTDIR=$(CURDIR)/debian/glasnost PREFIX=/usr GLASNOST=glasnost TEMPLATES='$(TEMPLATES)' PYTHON_VERSION=2.2
$(MAKE) install DESTDIR=$(CURDIR)/debian/glasnost PREFIX=/usr GLASNOST=glasnost TEMPLATES='$(TEMPLATES)' PYTHON_VERSION=2.2 SERVER_USER=glasnost-daemon
# note: python version is only specified to get to pygettext.py
#$(MAKE) install-templates DESTDIR=$(CURDIR)/debian/glasnost-web-extra-templates PREFIX=/usr GLASNOST=glasnost 'TEMPLATES=$(TEMPLATES)'
#for F in $(BASETEMPLATES); \

View File

@ -1,55 +0,0 @@
#!/bin/sh
#
# Glasnost
# By: Odile Bénassy <obenassy@entrouvert.com>
# Romain Chantereau <rchantereau@entrouvert.com>
# Nicolas Clapiès <nclapies@easter-eggs.org>
# Pierre-Antoine Dejace <padejace@entrouvert.be>
# Thierry Dulieu <tdulieu@easter-eggs.com>
# Florent Monnier <monnier@codelutin.com>
# Cédric Musso <cmusso@easter-eggs.org>
# Frédéric Péters <fpeters@entrouvert.be>
# Benjamin Poussin <poussin@codelutin.com>
# Emmanuel Raviart <eraviart@entrouvert.com>
# Sébastien Régnier <regnier@codelutin.com>
# Emmanuel Saracco <esaracco@easter-eggs.com>
#
# Copyright (C) 2000, 2001 Easter-eggs & Emmanuel Raviart
# Copyright (C) 2002 Odile Bénassy, Code Lutin, Thierry Dulieu, Easter-eggs,
# Entr'ouvert, Frédéric Péters, Benjamin Poussin, Emmanuel Raviart,
# Emmanuel Saracco & Théridion
# Copyright (C) 2003 Odile Bénassy, Romain Chantereau, Nicolas Clapiès,
# Code Lutin, Pierre-Antoine Dejace, Thierry Dulieu, Easter-eggs,
# Entr'ouvert, Florent Monnier, Cédric Musso, Ouvaton, Frédéric Péters,
# Benjamin Poussin, Rodolphe Quiédeville, Emmanuel Raviart, Sébastien
# Régnier, Emmanuel Saracco, Théridion & Vecam
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
WRAPPER=`dirname $0`/glasnost-variables-filename
VARIABLES=`$WRAPPER $0`
if [ -r $VARIABLES ]; then
. $VARIABLES
else
echo "Error $VARIABLES couldn't be found"
exit 1
fi
for SERV in $SERVERS
do
$SERVERSDIR/$SERV/$SERV.py -s glasnost://$1 -d glasnost://$2
done

185
glasnost-ctl.py Executable file
View File

@ -0,0 +1,185 @@
#! /usr/bin/env python
import __builtin__
import ConfigParser
import locale
import marshal
import os
import signal
import sys
import time
glasnostPythonDir = '/usr/local/lib/glasnost-devel' # changed on make install
sys.path.insert(0, glasnostPythonDir)
import glasnost
import glasnost.common.context as context
from glasnost.common.tools import *
import glasnost.common.tools_new as commonTools
config = ConfigParser.ConfigParser()
config.readfp(open(commonTools.configFile))
servers = ['Dispatcher',]
if 'Gateway' in config.sections():
servers += ['Gateway',]
if 'Cache' in config.sections():
servers += ['Cache',]
servers += [x for x in config.sections() if x.endswith('Server')]
def doStart():
print 'Starting Glasnost (%d servers) ' % len(servers),
sys.stdout.flush()
for server in servers:
rc = doStartOne(server)
if rc == 0:
sys.stdout.write('.')
sys.stdout.flush()
else:
sys.stdout.write('F')
sys.stdout.flush()
print ' done.'
def doStartOne(server):
serverFileName = '%s/servers/%s/%s.py' % (glasnostPythonDir, server, server)
return os.system(serverFileName)
def doStop():
print 'Stopping Glasnost...',
sys.stdout.flush()
for server in servers:
doStopOne(server)
print 'done.'
def doStopOne(server):
serverFileName = '%s/servers/%s/%s.py' % (glasnostPythonDir, server, server)
processes = [int(x.split()[0]) for x in os.popen('ps ax').readlines() \
if x.endswith(serverFileName + '\n')]
for process in processes:
os.kill(process, signal.SIGTERM)
def doRestartOne(server):
doStopOne(server)
time.sleep(1)
doStartOne(server)
def doLogRotate():
for server in servers:
serverFileName = '%s/servers/%s/%s.py' % (glasnostPythonDir, server, server)
processes = [int(x.split()[0]) for x in os.popen('ps ax').readlines() \
if x.endswith(serverFileName + '\n')]
for process in processes:
os.kill(process, signal.SIGHUP)
def doMakeSystem(sourceDispatcher):
systemServers = ['articles', 'atoms', 'cards', 'dataflows', 'pagenames', 'groups', 'rubrics', 'translations', 'uploadfiles']
for server in servers:
serverFileName = '%s/servers/%s/%s.py' % (glasnostPythonDir, server, server)
cmdLine = '%s -s glasnost://%s -y "%s"' % (serverFileName, sourceDispatcher,
repr(systemServers))
rc = os.system(cmdLine)
def doExport(sourceDispatcher):
for server in servers:
serverFileName = '%s/servers/%s/%s.py' % (glasnostPythonDir, server, server)
cmdLine = '%s -s glasnost://%s -x "%s"' % (serverFileName,
sourceDispatcher, os.getcwd())
rc = os.system(cmdLine)
def doImport(destDispatcher):
for server in servers:
serverFileName = '%s/servers/%s/%s.py' % (glasnostPythonDir, server, server)
cmdLine = '%s -i "%s" -d %s' % (serverFileName,
os.getcwd(), destDispatcher)
rc = os.system(cmdLine)
def doConvertIds(sourceDispatcher, destDispatcher):
for server in servers:
serverFileName = '%s/servers/%s/%s.py' % (glasnostPythonDir, server, server)
cmdLine = '%s -s %s -d %s' % (serverFileName,
sourceDispatcher, destDispatcher)
rc = os.system(cmdLine)
def doCompileTal(directory):
for lang in ['en', 'fr']:
print 'Compiling templates for %s ' % lang,
context.push(
readLanguages = [lang],
)
locale.setlocale(locale.LC_COLLATE, (lang, None))
translation = commonTools.translation(
['%s-web' % glasnost.applicationName,
'glasnost-lyon2003', 'glasnost-weblog', 'glasnost-metis'],
[lang] )
__builtin__.__dict__['_'] = translation.gettext
from glasnost.web.GlasnostTALGenerator import GlasnostTALGenerator
from TAL.HTMLTALParser import HTMLTALParser
for root, dir, files in os.walk(directory):
for file in files:
if not file.endswith('.tal') and not file.endswith('.html'):
continue
file = os.path.join(root, file)
p = HTMLTALParser(gen = GlasnostTALGenerator(xml=0))
try:
p.parseFile(file)
except faults.StringNotAvailableThroughGettext:
sys.stdout.write('-')
sys.stdout.flush()
continue
code = p.getCode()
marshal.dump(code, open('%sc.%s' % (file, lang), 'w'))
sys.stdout.write('.')
sys.stdout.flush()
print ''
def doUsage():
print """usage: %s (start|stop|make-system|export|import|convert-ids)""" % \
sys.argv[0]
print """
start start Glasnost servers
stop stop Glasnost servers
make-system $1 create glasnost://system from glasnost://$1
export $1 export glasnost://$1
import $1 import glasnost://$1
convert-ids $1 $2 convert ids from glasnost://$1 to glasnost://$2
compile-tal $1 compile TAL templates in directory $1 (and its leafs)
start-one $1 start Glasnost server named $1
stop-one $1 stop Glasnost server named $1
restart-one $1 restart Glasnost server named $1
"""
sys.exit(0)
if len(sys.argv) == 1:
doUsage()
elif sys.argv[1] == 'start':
doStart()
elif sys.argv[1] == 'stop':
doStop()
elif sys.argv[1] == 'start-one':
doStartOne(sys.argv[2])
elif sys.argv[1] == 'stop-one':
doStopOne(sys.argv[2])
elif sys.argv[1] == 'restart-one':
doRestartOne(sys.argv[2])
elif sys.argv[1] == 'make-system':
doMakeSystem(sys.argv[2])
elif sys.argv[1] == 'export':
doExport(sys.argv[2])
elif sys.argv[1] == 'import':
doImport(sys.argv[2])
elif sys.argv[1] == 'convert-ids':
doConvertIds(sys.argv[2], sys.argv[3])
elif sys.argv[1] == 'compile-tal':
doCompileTal(sys.argv[2])
elif sys.argv[1] == 'logrotate':
doLogRotate()
else:
doUsage()

View File

@ -1,54 +0,0 @@
#!/bin/sh
#
# Glasnost
# By: Odile Bénassy <obenassy@entrouvert.com>
# Romain Chantereau <rchantereau@entrouvert.com>
# Nicolas Clapiès <nclapies@easter-eggs.org>
# Pierre-Antoine Dejace <padejace@entrouvert.be>
# Thierry Dulieu <tdulieu@easter-eggs.com>
# Florent Monnier <monnier@codelutin.com>
# Cédric Musso <cmusso@easter-eggs.org>
# Frédéric Péters <fpeters@entrouvert.be>
# Benjamin Poussin <poussin@codelutin.com>
# Emmanuel Raviart <eraviart@entrouvert.com>
# Sébastien Régnier <regnier@codelutin.com>
# Emmanuel Saracco <esaracco@easter-eggs.com>
#
# Copyright (C) 2000, 2001 Easter-eggs & Emmanuel Raviart
# Copyright (C) 2002 Odile Bénassy, Code Lutin, Thierry Dulieu, Easter-eggs,
# Entr'ouvert, Frédéric Péters, Benjamin Poussin, Emmanuel Raviart,
# Emmanuel Saracco & Théridion
# Copyright (C) 2003 Odile Bénassy, Romain Chantereau, Nicolas Clapiès,
# Code Lutin, Pierre-Antoine Dejace, Thierry Dulieu, Easter-eggs,
# Entr'ouvert, Florent Monnier, Cédric Musso, Ouvaton, Frédéric Péters,
# Benjamin Poussin, Rodolphe Quiédeville, Emmanuel Raviart, Sébastien
# Régnier, Emmanuel Saracco, Théridion & Vecam
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
WRAPPER=`dirname $0`/glasnost-variables-filename
VARIABLES=`$WRAPPER $0`
if [ -r $VARIABLES ]; then
. $VARIABLES
else
echo "Error $VARIABLES couldn't be found"
exit 1
fi
for SERV in $SERVERS
do
$SERVERSDIR/$SERV/$SERV.py -s glasnost://$1 -x `pwd`
done

View File

@ -1,54 +0,0 @@
#!/bin/sh
#
# Glasnost
# By: Odile Bénassy <obenassy@entrouvert.com>
# Romain Chantereau <rchantereau@entrouvert.com>
# Nicolas Clapiès <nclapies@easter-eggs.org>
# Pierre-Antoine Dejace <padejace@entrouvert.be>
# Thierry Dulieu <tdulieu@easter-eggs.com>
# Florent Monnier <monnier@codelutin.com>
# Cédric Musso <cmusso@easter-eggs.org>
# Frédéric Péters <fpeters@entrouvert.be>
# Benjamin Poussin <poussin@codelutin.com>
# Emmanuel Raviart <eraviart@entrouvert.com>
# Sébastien Régnier <regnier@codelutin.com>
# Emmanuel Saracco <esaracco@easter-eggs.com>
#
# Copyright (C) 2000, 2001 Easter-eggs & Emmanuel Raviart
# Copyright (C) 2002 Odile Bénassy, Code Lutin, Thierry Dulieu, Easter-eggs,
# Entr'ouvert, Frédéric Péters, Benjamin Poussin, Emmanuel Raviart,
# Emmanuel Saracco & Théridion
# Copyright (C) 2003 Odile Bénassy, Romain Chantereau, Nicolas Clapiès,
# Code Lutin, Pierre-Antoine Dejace, Thierry Dulieu, Easter-eggs,
# Entr'ouvert, Florent Monnier, Cédric Musso, Ouvaton, Frédéric Péters,
# Benjamin Poussin, Rodolphe Quiédeville, Emmanuel Raviart, Sébastien
# Régnier, Emmanuel Saracco, Théridion & Vecam
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
WRAPPER=`dirname $0`/glasnost-variables-filename
VARIABLES=`$WRAPPER $0`
if [ -r $VARIABLES ]; then
. $VARIABLES
else
echo "Error $VARIABLES couldn't be found"
exit 1
fi
for SERV in $SERVERS
do
$SERVERSDIR/$SERV/$SERV.py -i `pwd` -d glasnost://$1
done

View File

@ -1,56 +0,0 @@
#!/bin/sh
#
# Glasnost
# By: Odile Bénassy <obenassy@entrouvert.com>
# Romain Chantereau <rchantereau@entrouvert.com>
# Nicolas Clapiès <nclapies@easter-eggs.org>
# Pierre-Antoine Dejace <padejace@entrouvert.be>
# Thierry Dulieu <tdulieu@easter-eggs.com>
# Florent Monnier <monnier@codelutin.com>
# Cédric Musso <cmusso@easter-eggs.org>
# Frédéric Péters <fpeters@entrouvert.be>
# Benjamin Poussin <poussin@codelutin.com>
# Emmanuel Raviart <eraviart@entrouvert.com>
# Sébastien Régnier <regnier@codelutin.com>
# Emmanuel Saracco <esaracco@easter-eggs.com>
#
# Copyright (C) 2000, 2001 Easter-eggs & Emmanuel Raviart
# Copyright (C) 2002 Odile Bénassy, Code Lutin, Thierry Dulieu, Easter-eggs,
# Entr'ouvert, Frédéric Péters, Benjamin Poussin, Emmanuel Raviart,
# Emmanuel Saracco & Théridion
# Copyright (C) 2003 Odile Bénassy, Romain Chantereau, Nicolas Clapiès,
# Code Lutin, Pierre-Antoine Dejace, Thierry Dulieu, Easter-eggs,
# Entr'ouvert, Florent Monnier, Cédric Musso, Ouvaton, Frédéric Péters,
# Benjamin Poussin, Rodolphe Quiédeville, Emmanuel Raviart, Sébastien
# Régnier, Emmanuel Saracco, Théridion & Vecam
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
WRAPPER=`dirname $0`/glasnost-variables-filename
VARIABLES=`$WRAPPER $0`
if [ -r $VARIABLES ]; then
. $VARIABLES
else
echo "Error $VARIABLES couldn't be found"
exit 1
fi
for SERV in $SERVERS
do
$SERVERSDIR/$SERV/$SERV.py -s glasnost://$1 -y "['articles', 'atoms', 'cards', 'dataflows', 'pagenames', 'groups', 'rubrics', 'translations', 'uploadfiles']"
done
exit 0

View File

@ -1,97 +0,0 @@
#!/bin/sh
#
# Glasnost
# By: Odile Bénassy <obenassy@entrouvert.com>
# Romain Chantereau <rchantereau@entrouvert.com>
# Nicolas Clapiès <nclapies@easter-eggs.org>
# Pierre-Antoine Dejace <padejace@entrouvert.be>
# Thierry Dulieu <tdulieu@easter-eggs.com>
# Florent Monnier <monnier@codelutin.com>
# Cédric Musso <cmusso@easter-eggs.org>
# Frédéric Péters <fpeters@entrouvert.be>
# Benjamin Poussin <poussin@codelutin.com>
# Emmanuel Raviart <eraviart@entrouvert.com>
# Sébastien Régnier <regnier@codelutin.com>
# Emmanuel Saracco <esaracco@easter-eggs.com>
#
# Copyright (C) 2000, 2001 Easter-eggs & Emmanuel Raviart
# Copyright (C) 2002 Odile Bénassy, Code Lutin, Thierry Dulieu, Easter-eggs,
# Entr'ouvert, Frédéric Péters, Benjamin Poussin, Emmanuel Raviart,
# Emmanuel Saracco & Théridion
# Copyright (C) 2003 Odile Bénassy, Romain Chantereau, Nicolas Clapiès,
# Code Lutin, Pierre-Antoine Dejace, Thierry Dulieu, Easter-eggs,
# Entr'ouvert, Florent Monnier, Cédric Musso, Ouvaton, Frédéric Péters,
# Benjamin Poussin, Rodolphe Quiédeville, Emmanuel Raviart, Sébastien
# Régnier, Emmanuel Saracco, Théridion & Vecam
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
WRAPPER=`dirname $0`/glasnost-variables-filename
VARIABLES=`$WRAPPER $0`
if [ -r $VARIABLES ]; then
. $VARIABLES
else
echo "Error $VARIABLES couldn't be found"
exit 1
fi
start () {
for SERV in $SERVERS
do
echo Starting $SERV
$PYTHON $SERVERSDIR/$SERV/$SERV.py
if [ "$SERV" = "Dispatcher" ]; then
sleep 5
fi
done
echo "Glasnost started. Don't forget to reload Apache."
}
stop () {
for SERV in $SERVERS
do
pid=`ps xawww | grep python |grep "$SERVERSDIR/$SERV/$SERV.py" |sed -e "s/^ *//" |cut -f1 -d' '|tr '\n' ' '`
if [ -n "$pid" ]; then
kill $pid
fi
done
}
ACTION=${1:-default}
if [ "$ACTION" = default ]; then
ACTION=`basename $0 |cut -f2 -d'-'`
fi
case "$ACTION" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 20
start
;;
*)
cat << EOF
Usage: $0 [start|stop|restart]
EOF
;;
esac

View File

@ -1,57 +0,0 @@
#!/bin/sh
#
# Glasnost
# By: Odile Bénassy <obenassy@entrouvert.com>
# Romain Chantereau <rchantereau@entrouvert.com>
# Nicolas Clapiès <nclapies@easter-eggs.org>
# Pierre-Antoine Dejace <padejace@entrouvert.be>
# Thierry Dulieu <tdulieu@easter-eggs.com>
# Florent Monnier <monnier@codelutin.com>
# Cédric Musso <cmusso@easter-eggs.org>
# Frédéric Péters <fpeters@entrouvert.be>
# Benjamin Poussin <poussin@codelutin.com>
# Emmanuel Raviart <eraviart@entrouvert.com>
# Sébastien Régnier <regnier@codelutin.com>
# Emmanuel Saracco <esaracco@easter-eggs.com>
#
# Copyright (C) 2000, 2001 Easter-eggs & Emmanuel Raviart
# Copyright (C) 2002 Odile Bénassy, Code Lutin, Thierry Dulieu, Easter-eggs,
# Entr'ouvert, Frédéric Péters, Benjamin Poussin, Emmanuel Raviart,
# Emmanuel Saracco & Théridion
# Copyright (C) 2003 Odile Bénassy, Romain Chantereau, Nicolas Clapiès,
# Code Lutin, Pierre-Antoine Dejace, Thierry Dulieu, Easter-eggs,
# Entr'ouvert, Florent Monnier, Cédric Musso, Ouvaton, Frédéric Péters,
# Benjamin Poussin, Rodolphe Quiédeville, Emmanuel Raviart, Sébastien
# Régnier, Emmanuel Saracco, Théridion & Vecam
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
ACCEPTED_RELEASE_TYPE="devel system tests"
RELEASE_TYPE=`basename $1|cut -f2 -d-`
DIRECTORY=`dirname $1`
result=glasnost
for accept in $ACCEPTED_RELEASE_TYPE
do
if [ "$RELEASE_TYPE" = "$accept" ]; then
result=${result}-$RELEASE_TYPE
break
fi
done
result=${result}-variables
echo $DIRECTORY/$result

View File

@ -1,73 +0,0 @@
#!/bin/sh
#
# Glasnost
# By: Odile Bénassy <obenassy@entrouvert.com>
# Romain Chantereau <rchantereau@entrouvert.com>
# Nicolas Clapiès <nclapies@easter-eggs.org>
# Pierre-Antoine Dejace <padejace@entrouvert.be>
# Thierry Dulieu <tdulieu@easter-eggs.com>
# Florent Monnier <monnier@codelutin.com>
# Cédric Musso <cmusso@easter-eggs.org>
# Frédéric Péters <fpeters@entrouvert.be>
# Benjamin Poussin <poussin@codelutin.com>
# Emmanuel Raviart <eraviart@entrouvert.com>
# Sébastien Régnier <regnier@codelutin.com>
# Emmanuel Saracco <esaracco@easter-eggs.com>
#
# Copyright (C) 2000, 2001 Easter-eggs & Emmanuel Raviart
# Copyright (C) 2002 Odile Bénassy, Code Lutin, Thierry Dulieu, Easter-eggs,
# Entr'ouvert, Frédéric Péters, Benjamin Poussin, Emmanuel Raviart,
# Emmanuel Saracco & Théridion
# Copyright (C) 2003 Odile Bénassy, Romain Chantereau, Nicolas Clapiès,
# Code Lutin, Pierre-Antoine Dejace, Thierry Dulieu, Easter-eggs,
# Entr'ouvert, Florent Monnier, Cédric Musso, Ouvaton, Frédéric Péters,
# Benjamin Poussin, Rodolphe Quiédeville, Emmanuel Raviart, Sébastien
# Régnier, Emmanuel Saracco, Théridion & Vecam
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
SERVERSDIR=@SERVERDIR@
PYTHON=python@PYTHON_VERSION@
SERVERS="Dispatcher \
Gateway \
AppointmentsServer \
ArticlesServer \
AtomsServer \
AuthenticationLdapServer \
AuthenticationLoginPasswordServer \
AuthenticationServer \
BallotsServer \
BrevesServer \
Cache \
CardsServer \
CommentsServer \
DataflowsServer \
ElectionsServer \
ForumsServer \
GradesServer \
GroupsServer \
PageNamesServer \
PeopleServer \
PreferencesServer \
RubricsServer \
SessionsServer \
SystemFilesServer \
TranslationsServer \
UploadFilesServer \
VirtualHostsServer \
VotesServer"