diff options
author | Achim Gottinger <achim@gentoo.org> | 2000-12-13 15:13:59 +0000 |
---|---|---|
committer | Achim Gottinger <achim@gentoo.org> | 2000-12-13 15:13:59 +0000 |
commit | 6d0998827a8dbca950b80683bfd723b6bd868bf0 (patch) | |
tree | a10d4424db190027b3d2577507696f7e50f6737d | |
parent | *** empty log message *** (diff) | |
download | historical-6d0998827a8dbca950b80683bfd723b6bd868bf0.tar.gz historical-6d0998827a8dbca950b80683bfd723b6bd868bf0.tar.bz2 historical-6d0998827a8dbca950b80683bfd723b6bd868bf0.zip |
supervise fixes
-rwxr-xr-x | net-misc/openssh/files/sshd | 50 | ||||
-rw-r--r-- | net-misc/openssh/openssh-2.3.0_p1-r1.ebuild | 20 | ||||
-rwxr-xr-x | sys-apps/baselayout/files/rc.d/init.d/sysklogd | 61 | ||||
-rwxr-xr-x | sys-apps/gluelog/files/sysklogd | 37 | ||||
-rw-r--r-- | sys-apps/gluelog/gluelog-1.0.ebuild | 14 | ||||
-rw-r--r-- | sys-apps/textutils/textutils-2.0.10.ebuild | 3 |
6 files changed, 112 insertions, 73 deletions
diff --git a/net-misc/openssh/files/sshd b/net-misc/openssh/files/sshd index efbe0bf9b379..d89e5c133d7d 100755 --- a/net-misc/openssh/files/sshd +++ b/net-misc/openssh/files/sshd @@ -2,26 +2,67 @@ #RCUPDATE:2 3 4:75:This line is required for script management . /etc/rc.d/config/functions +. /etc/rc.d/config/basic -SERVICE="supervised OpenSSH" +SERVICE="OpenSSH" opts="start stop restart" PIDFILE=/var/run/sshd.pid EXE=/usr/sbin/sshd +if [ "`supervised`" ] +then + echo "Super" +else + echo "$SUPERVISE" + echo $0 +fi + +gen_keys() { + + if [ ! -e /etc/ssh/ssh_host_key ] ; then + einfo "Generate Hostkey..." + /usr/bin/ssh-keygen -b 1024 -f /etc/ssh/ssh_host_key -N '' + fi + + if [ ! -e /etc/ssh/ssh_host_dsa_key ] ; then + einfo "Generate DSA-Hostkey..." + /usr/bin/ssh-keygen -d -f /etc/ssh/ssh_host_dsa_key -N '' + fi + +} + start() { + gen_keys ebegin "Starting $SERVICE..." - /usr/bin/svc -u /etc/svc.d/control/sshd + start-stop-daemon --start --quiet --exec $EXE eend $? "Started $SERVICE." "Error Starting $SERVICE." } stop() { + ebegin "Stopping $SERVICE..." - /usr/bin/svc -d /etc/svc.d/control/sshd + start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $EXE eend $? "Stopped $SERVICE." "Error Stopping $SERVICE." } +supervise_start() { + + gen_keys + + ebegin "Starting $SERVICE supervised..." + /usr/bin/svc -u /etc/svc.d/control/sshd + eend $? "Started $SERVICE." "Error Starting $SERVICE supervised." +} + +supervise_stop() { + + ebegin "Stopping $SERVICE supervised..." + /usr/bin/svc -d /etc/svc.d/control/sshd + eend $? "Stopped $SERVICE." "Error Stopping $SERVICE supervised." +} + restart() { stop start @@ -30,3 +71,6 @@ restart() { doservice ${@} + + + diff --git a/net-misc/openssh/openssh-2.3.0_p1-r1.ebuild b/net-misc/openssh/openssh-2.3.0_p1-r1.ebuild index db96fd2f7ea9..bf557122d44b 100644 --- a/net-misc/openssh/openssh-2.3.0_p1-r1.ebuild +++ b/net-misc/openssh/openssh-2.3.0_p1-r1.ebuild @@ -1,7 +1,7 @@ # Copyright 1999-2000 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # Author Achim Gottinger <achim@gentoo.org> -# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/openssh-2.3.0_p1-r1.ebuild,v 1.2 2000/12/10 05:35:55 drobbins Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/openssh-2.3.0_p1-r1.ebuild,v 1.3 2000/12/13 15:13:59 achim Exp $ P=openssh-2.3.0p1 A=${P}.tar.gz @@ -44,29 +44,11 @@ src_install() { dosym ../services/sshd /etc/svc.d/control/sshd } -pkg_preinst() { - [ "$ROOT" = "/" ] && [ -e /etc/rc.d/init.d/sshd ] && /etc/rc.d/init.d/sshd stop - ${ROOT}/etc/rc.d/init.d/rc-update del sshd -} pkg_postinst() { # Make ssh start at boot . ${ROOT}/etc/rc.d/config/functions einfo ">>> Generating symlinks" ${ROOT}/usr/sbin/rc-update add sshd - if [ ! -e ${ROOT}/etc/ssh/ssh_host_key ] ; then - einfo "Generating system RSA key..." - ${ROOT}/usr/bin/ssh-keygen -b 1024 -f ${ROOT}/etc/ssh/ssh_host_key -N '' - else - einfo "System RSA key already exists, skipping..." - fi - - if [ ! -e ${ROOT}/etc/ssh/ssh_host_dsa_key ] ; then - einfo "Generating system DSA key..." - ${ROOT}/usr/bin/ssh-keygen -d -f ${ROOT}/etc/ssh/ssh_host_dsa_key -N '' - else - einfo "System DSA key already exists, skipping..." - fi - [ "$ROOT" = "/" ] && /etc/rc.d/init.d/sshd start } diff --git a/sys-apps/baselayout/files/rc.d/init.d/sysklogd b/sys-apps/baselayout/files/rc.d/init.d/sysklogd new file mode 100755 index 000000000000..87d35fc0bb72 --- /dev/null +++ b/sys-apps/baselayout/files/rc.d/init.d/sysklogd @@ -0,0 +1,61 @@ +#!/bin/sh +#RCUPDATE:1 2 3 4 5:19:This line is required for script management + +klog="/usr/sbin/klogd" +slog="/usr/sbin/syslogd" + +. /etc/rc.d/config/functions +. /etc/rc.d/config/basic + +SERVICE=sysklogd +opts="start stop restart reconfig" + +start() { + ebegin "Starting syslogd, klogd" + start-stop-daemon --start --exec $slog -- $SYSLOGD 1>&2 + retval=$? + start-stop-daemon --start --exec $klog -- $KLOGD 1>&2 + retval=$(( $retval + $? )) + eend $retval +} + +stop() { + ebegin "Stopping klogd, syslogd" + start-stop-daemon --stop --pidfile /var/run/klogd.pid 1>&2 + retval=$? + start-stop-daemon --stop --pidfile /var/run/syslogd.pid 1>&2 + retval=$(( $retval + $? )) + eend $retval +} +supervise_start() { + ebegin "Starting supervised syslog and klog" + local retval + local x + retval=0 + + for x in klog syslog + do + /usr/bin/svc -u /etc/svc.d/control/${x} + retval=$(( $? + $retval )) + done + eend $retval +} + +supervise_stop() { + ebegin "Stopping supervised syslog and klog" + /usr/bin/svc -d /etc/svc.d/control/klog /etc/svc.d/control/syslog + eend $? +} + +restart() { + + stop + start + +} + + +doservice ${@} + + + diff --git a/sys-apps/gluelog/files/sysklogd b/sys-apps/gluelog/files/sysklogd deleted file mode 100755 index f69975f5d85b..000000000000 --- a/sys-apps/gluelog/files/sysklogd +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -#RCUPDATE:1 2 3 4 5:20:This line is required for script management - -klog="/usr/sbin/klogd" -slog="/usr/sbin/syslogd" - -. /etc/rc.d/config/functions - -SERVICE=sysklogd -opts="start stop status" - -start() { - ebegin "Starting supervised syslog and klog" - local retval - local x - retval=0 - - for x in klog syslog - do - /usr/bin/svc -u /etc/svc.d/control/${x} - retval=$(( $? + $retval )) - done - eend $retval -} - -stop() { - ebegin "Stopping supervised syslog and klog" - /usr/bin/svc -d /etc/svc.d/control/klog /etc/svc.d/control/syslog - eend $? -} - -status() { - einfo "syslog and klog status:" - /usr/bin/svstat /etc/svc.d/control/klog /etc/svc.d/control/syslog -} - -doservice ${@} diff --git a/sys-apps/gluelog/gluelog-1.0.ebuild b/sys-apps/gluelog/gluelog-1.0.ebuild index 519feebe2ca6..bf39bf360054 100644 --- a/sys-apps/gluelog/gluelog-1.0.ebuild +++ b/sys-apps/gluelog/gluelog-1.0.ebuild @@ -1,7 +1,7 @@ # Copyright 1999-2000 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # Author Daniel Robbins <drobbins@gentoo.org> -# $Header: /var/cvsroot/gentoo-x86/sys-apps/gluelog/gluelog-1.0.ebuild,v 1.2 2000/12/10 05:35:55 drobbins Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/gluelog/gluelog-1.0.ebuild,v 1.3 2000/12/13 15:13:59 achim Exp $ S=${WORKDIR}/${P} DESCRIPTION="Pipe and socket fittings for the system and kernel logs" @@ -33,17 +33,5 @@ src_install() { touch ${D}/etc/svc.d/services/${x}/down install -d -m0750 -o daemon -g wheel ${D}/var/log/${x}.d done - exeopts -m0755 - exeinto /etc/rc.d/init.d - doexe ${FILESDIR}/sysklogd } -pkg_preinst() { - [ "$ROOT" = "/" ] && [ -e /etc/rc.d/init.d/sysklogd ] && /etc/rc.d/init.d/sysklogd stop - ${ROOT}/usr/sbin/rc-update del sysklogd -} - -pkg_postinst() { - ${ROOT}/usr/sbin/rc-update add sysklogd - [ "$ROOT" = "/" ] && /etc/rc.d/init.d/sysklogd start -} diff --git a/sys-apps/textutils/textutils-2.0.10.ebuild b/sys-apps/textutils/textutils-2.0.10.ebuild index dd74a07a4b56..08c79e858442 100644 --- a/sys-apps/textutils/textutils-2.0.10.ebuild +++ b/sys-apps/textutils/textutils-2.0.10.ebuild @@ -1,7 +1,7 @@ # Copyright 1999-2000 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # Author Daniel Robbins <drobbins@gentoo.org> -# $Header: /var/cvsroot/gentoo-x86/sys-apps/textutils/textutils-2.0.10.ebuild,v 1.1 2000/12/11 20:05:17 drobbins Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/textutils/textutils-2.0.10.ebuild,v 1.2 2000/12/13 15:13:59 achim Exp $ A=${P}.tar.gz S=${WORKDIR}/${P} @@ -11,6 +11,7 @@ SRC_URI="ftp://alpha.gnu.org/gnu/fetish/${A}" DEPEND=">=sys-libs/glibc-2.1.3" src_compile() { + echo $S $WORKDIR `pwd` try ./configure --prefix=/usr --host=${CHOST} --build=${CHOST} \ --without-included-regex try make ${MAKEOPTS} |