From 9cd03f2bdf35864752d78277ca28652476132385 Mon Sep 17 00:00:00 2001 From: kueller Date: Sat, 3 May 2008 16:58:44 +0000 Subject: [PATCH] V961 Tree Umbau git-svn-id: svn://svn.compuextreme.de/Viitor/V961/Viitor_dbus@4245 504e572c-2e33-0410-9681-be2bf7408885 --- etc/init.d/dbus | 103 +++++++++++++++++++++++++++++++++++ etc/sysconfig/profile.d/dbus | 57 +++++++++++++++++++ init/genpkg | 39 +++++++++++++ tmp/postinstall | 46 ++++++++++++++++ 4 files changed, 245 insertions(+) create mode 100755 etc/init.d/dbus create mode 100644 etc/sysconfig/profile.d/dbus create mode 100644 init/genpkg create mode 100644 tmp/postinstall diff --git a/etc/init.d/dbus b/etc/init.d/dbus new file mode 100755 index 0000000..d25f34d --- /dev/null +++ b/etc/init.d/dbus @@ -0,0 +1,103 @@ +#!/bin/bash +#Framework, welches ein komplettes Linux System aus den Sourcen erstellt +#dieses Framework wird im CVS Repository +#:pserver:cvs.compuextreme.de:/Data/cvs zur Verfügung gestellt +# +#Lage dieser Datei im Archiv: $Source$ +# +#(c) 2003 Harald Kueller, Germany +#This program is free software; you can redistribute it and/or +#modify ist 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. +# +#InitScript zum Start des Daemons: +# +#Letzte Änderung von: $Author$ +#Datum der letzten Änderung: $Date$ +#Version der Datei: $Revision$ +# +#$Log$ +#Revision 1.7 2007/04/28 20:13:35 kueller +#Entspricht eigentlich wieder der Version 1.5 -> Rev. 1.6 war ein +#Fehlerhafter checkin eines Files fuer /etc/sysconfig/profile.d, +#nicht fuer /etc/init.d +# +#Revision 1.5 2007/04/13 09:22:39 kueller +#Anpassung des startup -> Dbus wird nun mit systemweiter Konfiguration gestartet +#neue postinstall installiert den in der neuen version erwarteten user messagebus +# +#Revision 1.4 2007/04/12 10:01:17 kueller +#Startup fehler wegen vorhandenem /var/run/dbus/pid nach +#system absturz wird nun aufgefangen +# +#Revision 1.3 2007/02/18 08:59:04 kueller +#PATH erweitert, so das dbus-launch, sowie die zugehoerigen daemons gefunden +#werden. +# +#Revision 1.2 2006/07/18 13:26:27 kueller +#Aufgrund neuer configure optionen (sysstatedir) ist /var/run/dbus nun ein +#verzeichniss. initscript entsprechend geaendert. Ausserdem wird mehrmaliges +#aufrufen mit "stop" option jetzt abgefangen +# +#Revision 1.1.1.1 2006/07/18 12:54:21 kueller +#Startup Script fuer dbus +# +# + +source /etc/init.d/functions + +case "$1" in + start) + if [ -f /var/run/dbus/pid ]; then + if [ "`pgrep dbus-daemon`" == "`cat /var/run/dbus/pid`" ]; then + echo "The dbus deamon is already running with pid `cat /var/run/dbus/pid`" + exit 10 + else + rm /var/run/dbus/* + fi + fi + export PATH=$PATH:/usr/X11R7/bin + echo -n "Starting dbus messaging system" + dbus-launch --config-file /etc/sysconfig/dbus/dbus-1/system.conf >/tmp/dbus_startup && \ + source /tmp/dbus_startup && \ + rm /tmp/dbus_startup && \ + echo $DBUS_SESSION_BUS_PID >/var/run/dbus/pid && \ + echo "DBUS_SESSION_BUS_ADDRESS='$DBUS_SESSION_BUS_ADDRESS'" \ + >/var/run/dbus/address + evaluate_retval + ;; + + stop) + if [ ! -f /var/run/dbus/pid ]; then + echo "dbus is not running!" + exit 10 + fi + echo -n "Stopping dbus messaging system" + kill `cat /var/run/dbus/pid` && + rm /var/run/dbus/pid && + rm /var/run/dbus/address + evaluate_retval + ;; + + restart) + $0 stop + sleep 1 + $0 start + ;; + + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; + +esac diff --git a/etc/sysconfig/profile.d/dbus b/etc/sysconfig/profile.d/dbus new file mode 100644 index 0000000..cd8e2ce --- /dev/null +++ b/etc/sysconfig/profile.d/dbus @@ -0,0 +1,57 @@ +#!/bin/bash +#Framework, welches ein komplettes Linux System aus den Sourcen erstellt +#dieses Framework wird im CVS Repository +#:pserver:cvs.compuextreme.de:/Data/cvs zur Verfügung gestellt +# +#Lage dieser Datei im Archiv: $Source$ +# +#(c) 2003 Harald Kueller, Germany +#This program is free software; you can redistribute it and/or +#modify ist 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. +# +#Script: +# +# initialiyes the dbus session bus +# for the user session +# +#Letzte Änderung von: $Author$ +#Datum der letzten Änderung: $Date$ +#Version der Datei: $Revision$ +# +#$Log$ +#Revision 1.4 2007/04/24 19:15:19 kueller +#kein neustart des session dbus mehr, sondern initialisierung des Environments +#mit den daten des laufenden System dbus +# +#Revision 1.3 2007/04/17 12:06:52 kueller +#dbus brauch hier noch den absoluten pfad zum binary +# +#Revision 1.2 2007/04/17 10:34:04 kueller +#Bei jedem Login werden jetzt alte dbus-session prozesse aufgeraeumt, bevor +#der session bus fuer die session neu initialisiert wird +# +#Revision 1.1 2007/04/17 10:26:51 kueller +#Initialisierung fuer dbus in der user session hinzugefuegt +# +# + +if [ -f /var/run/dbus/address ]; then + source /var/run/dbus/address + export DBUS_SESSION_BUS_ADDRESS +fi +if [ -f /var/run/dbus/pid ]; then + DBUS_SESSION_BUS_PID=`cat /var/run/dbus/pid` + export DBUS_SESSION_BUS_PID +fi + diff --git a/init/genpkg b/init/genpkg new file mode 100644 index 0000000..a9c4ec9 --- /dev/null +++ b/init/genpkg @@ -0,0 +1,39 @@ +#!/bin/bash +#genpkg Script für fam +#(c) 2005, Harald Kueller +# +#$Author$ +#$Date$ +#$Revision$ +# +#$Log$ +#Revision 1.2 2007/04/13 09:28:52 kueller +#tartup fuer dbus erfolgt nun frueher, da dbus fuer diverse andere Dienste +#bereits gestartet sein muss.. +# +#Revision 1.1.1.1 2006/07/18 12:54:21 kueller +#Startup Script fuer dbus +# +#Revision 1.1.1.1 2006/07/07 20:45:00 kueller +#neu fuer udev - wird leider nicht mehr bei den sourcen mitgeliefert +# +#Revision 1.1.1.1 2005/11/28 13:40:29 kueller +#new server daemon fam +# +# + +WDIR=`pwd` +cd etc/init.d +chmod 755 dbus +mkdir rc{0,1,2,3,4,5,6}.d +for i in 0 1 6; do + cd rc$i.d + ln -s ../dbus K74dbus + cd .. +done +for i in 2 3 4 5; do + cd rc$i.d + ln -s ../dbus S12dbus + cd .. +done +cd $WDIR diff --git a/tmp/postinstall b/tmp/postinstall new file mode 100644 index 0000000..68c1135 --- /dev/null +++ b/tmp/postinstall @@ -0,0 +1,46 @@ +#!/bin/bash +#Framework, welches ein komplettes Linux System aus den Sourcen erstellt +#dieses Framework wird im CVS Repository +#:pserver:cvs.rainmaker-mm.de/RMM/cvs zur Verfügung gestellt +# +#Lage dieser Datei im Archiv: $Source$ +# +#(c) Rainmaker MultiMedia OHG +#This program is free software; you can redistribute it and/or +#modify ist 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. +# +#Beschreibung: +# +#legt den von dbus benoetigten user messagebus local an +# +#Aufrufparameter: +#keine +# +#Letzte Änderung von: $Author$ +#Datum der letzten Änderung: $Date$ +#Version der Datei: $Revision$ +# +#$Log$ +#Revision 1.2 2007/04/29 10:24:35 kueller +#Messagebus user bekommt feste uid 42 und gruppe daemon -> benoetigt keine +#eigene gruppe! +# +#Revision 1.1 2007/04/13 09:22:39 kueller +#Anpassung des startup -> Dbus wird nun mit systemweiter Konfiguration gestartet +#neue postinstall installiert den in der neuen version erwarteten user messagebus +# + +if ! getent passwd messagebus 2>&1 >/dev/null; then + useradd -u 42 messagebus -g daemon -s /bin/false -d /tmp +fi