From 6d5d2a770400bd1b0c4d38298c3f3103e58e0257 Mon Sep 17 00:00:00 2001 From: kueller Date: Sat, 3 May 2008 16:58:48 +0000 Subject: [PATCH] V961 Tree Umbau git-svn-id: svn://svn.compuextreme.de/Viitor/V961/Viitor_inn@4264 504e572c-2e33-0410-9681-be2bf7408885 --- etc/init.d/inn | 84 +++++++++++++++++++++++++++++++++++++ etc/sysconfig/profile.d/inn | 17 ++++++++ init/genpkg | 53 +++++++++++++++++++++++ opt/inn/.profile | 6 +++ tmp/postinstall | 79 ++++++++++++++++++++++++++++++++++ 5 files changed, 239 insertions(+) create mode 100644 etc/init.d/inn create mode 100755 etc/sysconfig/profile.d/inn create mode 100644 init/genpkg create mode 100644 opt/inn/.profile create mode 100644 tmp/postinstall diff --git a/etc/init.d/inn b/etc/init.d/inn new file mode 100644 index 0000000..12aa94f --- /dev/null +++ b/etc/init.d/inn @@ -0,0 +1,84 @@ +#!/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: innd +# +#Letzte Änderung von: $Author$ +#Datum der letzten Änderung: $Date$ +#Version der Datei: $Revision$ +# +#$Log$ +#Revision 1.5 2006/09/25 12:49:50 segler +#inn wants to be stopped without loadproc +# +#Revision 1.4 2006/09/25 12:46:24 segler +#inn wants to be stopped by root +# +#Revision 1.3 2006/09/25 10:53:31 segler +#bug in startup script: if ... - f (-f is correct) +#postinstall gives all in /opt/inn/db/* to news (not only active files) +# +#Revision 1.2 2006/06/29 14:55:14 segler +#init script starts and stops now +# +#Revision 1.1 2006/06/29 14:36:44 segler +#start environment added. at this time it only generates a cert file (hopefully ;> ) +# +# + +source /etc/init.d/functions + +case "$1" in + start) + echo -n "Starting innd" + if [ ! -f /opt/inn/lib/key.pem ]; then + openssl req -new -x509 -nodes \ + -out /opt/inn/lib/cert.pem -days 366 \ + -keyout /opt/inn/lib/key.pem + chown news /opt/inn/lib/cert.pem + chgrp uucp /opt/inn/lib/cert.pem + chmod 640 /opt/inn/lib/cert.pem + chown news /opt/inn/lib/key.pem + chgrp uucp /opt/inn/lib/key.pem + chmod 600 /opt/inn/lib/key.pem + fi + + loadproc su - news -c /opt/inn/bin/rc.news + ;; + + stop) + echo -n "Stopping innd" + /opt/inn/bin/rc.news stop + ;; + + restart) + $0 stop + sleep 1 + $0 start + ;; + + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; + +esac diff --git a/etc/sysconfig/profile.d/inn b/etc/sysconfig/profile.d/inn new file mode 100755 index 0000000..893f848 --- /dev/null +++ b/etc/sysconfig/profile.d/inn @@ -0,0 +1,17 @@ +#!/bin/bash +# Initialisierungen fuer inn +# (c) Harald Kueller, Compuextreme +# +# $Author$ +# $Date$ +# $Revision$ +# +# $Log$ +# Revision 1.1 2006/08/07 09:59:53 kueller +# Shell initialisierung fuer inn hinzugefuegt (PATH, MANPATH). +# +# + +PATH=$PATH:/opt/inn/bin +MANPATH=$MANPATH:/opt/inn/man +export PATH MANPATH diff --git a/init/genpkg b/init/genpkg new file mode 100644 index 0000000..ea2c689 --- /dev/null +++ b/init/genpkg @@ -0,0 +1,53 @@ +#!/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: genpkg inn +# +#Letzte Änderung von: $Author$ +#Datum der letzten Änderung: $Date$ +#Version der Datei: $Revision$ +# +#$Log$ +#Revision 1.1 2006/06/29 14:36:44 segler +#start environment added. at this time it only generates a cert file (hopefully ;> ) +# +# + +WDIR=`pwd` +cd etc/init.d +chmod 755 inn + +mkdir rc{0,1,2,3,4,5,6}.d + +for i in 0 1 6; do + cd rc$i.d + ln -s /etc/init.d/inn K02inn + cd .. +done + +for i in 2 3 4 5; do + cd rc$i.d + ln -s /etc/init.d/inn S21inn + cd .. +done + +cd $WDIR diff --git a/opt/inn/.profile b/opt/inn/.profile new file mode 100644 index 0000000..0fcaaff --- /dev/null +++ b/opt/inn/.profile @@ -0,0 +1,6 @@ +#!/bin/bash + +PATH=$PATH:/opt/inn/bin +MANPATH=$MANPATH:/opt/inn/man + +export PATH MANPATH diff --git a/tmp/postinstall b/tmp/postinstall new file mode 100644 index 0000000..0b1e0e7 --- /dev/null +++ b/tmp/postinstall @@ -0,0 +1,79 @@ +#!/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: inn postinstall +# +#Letzte Änderung von: $Author$ +#Datum der letzten Änderung: $Date$ +#Version der Datei: $Revision$ +# +#$Log$ +#Revision 1.8 2007/04/29 12:39:32 kueller +#Festlegung der GID und UID fuer uucp. GID wird ein alias fuer dialout +# +#Revision 1.7 2006/09/26 10:33:04 segler +#pullnews likes the home directory /opt/inn owned by news:uucp +# +#Revision 1.6 2006/09/26 10:32:00 segler +#Viitor_inn->postinstall und tools/inn setzen ein paar Rechte neu +#die Tools newsx und suck fliegen raus, weil das perlscript pullnews das nun +#tut und pullnews Bestandteil vom inn est +# +#Revision 1.5 2006/09/25 10:53:31 segler +#bug in startup script: if ... - f (-f is correct) +#postinstall gives all in /opt/inn/db/* to news (not only active files) +# +#Revision 1.4 2006/06/29 14:44:33 segler +#user news.uucp likes to have (42/42) +# +#Revision 1.3 2006/06/29 13:31:50 segler +#some ownership / rights modifications to db.active +# +#Revision 1.2 2006/06/29 13:19:58 segler +#group news now is uucp +# +#Revision 1.1.1.1 2006/06/29 12:58:23 segler +#initial +# +# + +if ! getent group uucp 2>&1 >/dev/null; then + groupadd -o -g 10 uucp +fi + +if ! getent passwd uucp 2>&1 >/dev/null; then + useradd -u 52 -g uucp -d /opt/inn news +fi + +chown news /opt/inn/db/* +chgrp uucp /opt/inn/db/* +chmod 0664 /opt/inn/db/* + +chown news /opt/inn +chgrp uucp /opt/inn + +# check with inncheck +chmod 0640 /etc/inn/control.ctl +chmod 0640 /etc/inn/expire.ctl +chmod 0640 /etc/inn/expire.ctl +chmod 0640 /etc/inn/nntpsend.ctl +chmod 0640 /etc/inn/readers.conf