Hi, the improvment: so far $SVCDIR is defined in /etc/init.d/functions.sh - this i believe is from the time where /etc/conf.d/ not yet existed. the new version makes a /etc/conf.d/svscan which sets $SVCDIR. some improvements to the startup script are included as well... it's probably not a good idea to remove $SVCDIR from functions.sh right now... the next djbdns ebuild gontran@gontran.net and i are working on (see gentoo-dev) will include setup scripts that might already depend on SVCDIR being in /etc/conf.d/svscan.. greetings Thilo == daemontools-0.76-r2.build ==================== # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # Maintainer: Geert Bevin <gbevin@theleaf.be> # /space/gentoo/cvsroot/gentoo-x86/sys-apps/daemontools/daemontools-0.76-r1.ebuild,v 1.2 2001/12/31 23:47:55 azarah Exp S=${WORKDIR}/admin/${P} DESCRIPTION="Collection of tools for managing UNIX services" SRC_URI="http://cr.yp.to/daemontools/${P}.tar.gz" HOMEPAGE="http://cr.yp.to/daemontools.html" DEPEND="virtual/glibc" src_unpack() { unpack ${A} cd ${S} echo "gcc ${CFLAGS}" > src/conf-cc echo "gcc" > src/conf-ld echo ${S} > src/home } src_compile() { cd ${S}/src emake || die } src_install() { einfo "Installing package ..." cd ${S}/src exeinto /usr/bin for x in `cat ../package/commands` do doexe $x done dodoc CHANGES ../package/README TODO einfo "Installing the svscan startup file ..." exeinto /etc/init.d newexe ${FILESDIR}/svscan-r2 svscan insinto /etc/conf.d newins ${FILESDIR}/svscan.conf.d svscan } pkg_postinst() { echo einfo "Please configure svscan in /etc/conf.d/svscan!" echo } == files/digest-daemontools-0.76-r2 =================== MD5 1871af2453d6e464034968a0fbcb2bfc daemontools-0.76.tar.gz 36975 == files/svscan-r2 (new startupscript) =================== #!/sbin/runscript # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # /space/gentoo/cvsroot/gentoo-x86/sys-apps/daemontools/files/svscan,v 1.2 2001/12/06 20:17:02 azarah Exp #NB: config is in /etc/conf.d/svscan depend() { need net } start() { if [ ! -e /service ] then einfo "Creating service directory ( /service )..." mkdir /service fi ebegin "Starting service scan ..." PATH="/usr/bin:$PATH" cd /service start-stop-daemon --start --quiet --exec /usr/bin/svscan -- & echo $! > /var/run/svscan.pid eend $? } stop() { ebegin "Stopping service scan ..." start-stop-daemon --stop --quiet --pid /var/run/svscan.pid eend $? if [ -e /service/* ] then ebegin "Stopping services ..." svc -dx /service/* eend $? ebegin "Stopping service logging ..." svc -dx /service/*/log eend $? fi } == files/svscan.conf.d ============ #Supervise Dir # the directory where services are installed # and then linked to /service # SVCDIR=/var/lib/supervise #default SVCDIR=/var/lib/supervise
i am not sure if i understood SVCDIR's function correctly, but SVCDIR=/service would be a lot better Thilo
and then, most of this would need reworked again :-( i am sorry... but i could do that if you want me too Thilo
Hi, okay - now for the real thing! this defines SVCDIR to be /service (this is how it is now) - it also uses SVCDIR in the startup scripts effectivly making it configurable what is SVCDIR in /etc/init.d/functions.sh good for anyway???? == daemontools-0.76-r2.ebuild =========== # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # Maintainer: Geert Bevin <gbevin@theleaf.be> # /space/gentoo/cvsroot/gentoo-x86/sys-apps/daemontools/daemontools-0.76-r1.ebuild,v 1.2 2001/12/31 23:47:55 azarah Exp S=${WORKDIR}/admin/${P} DESCRIPTION="Collection of tools for managing UNIX services" SRC_URI="http://cr.yp.to/daemontools/${P}.tar.gz" HOMEPAGE="http://cr.yp.to/daemontools.html" DEPEND="virtual/glibc" src_unpack() { unpack ${A} cd ${S} echo "gcc ${CFLAGS}" > src/conf-cc echo "gcc" > src/conf-ld echo ${S} > src/home } src_compile() { cd ${S}/src emake || die } src_install() { einfo "Installing package ..." cd ${S}/src exeinto /usr/bin for x in `cat ../package/commands` do doexe $x done dodoc CHANGES ../package/README TODO einfo "Installing the svscan startup file ..." exeinto /etc/init.d newexe ${FILESDIR}/svscan-r2 svscan insinto /etc/conf.d newins ${FILESDIR}/svscan.conf.d svscan } pkg_postinst() { echo einfo "Please configure daemontools in /etc/conf.d/svscan!" echo } == files/svscan.conf.d ============== #Supervise Dir # the directory where services are installed # and then linked to /service # SVCDIR=/service #default SVCDIR=/service == files/svscan.rc ========= #!/sbin/runscript # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # /space/gentoo/cvsroot/gentoo-x86/sys-apps/daemontools/files/svscan,v 1.2 2001/12/06 20:17:02 azarah Exp #NB: config is in /etc/conf.d/svscan depend() { need net } start() { if [ ! -e $SVCDIR ] then einfo "Creating service directory ( $SVCDIR )..." mkdir $SVCDIR fi ebegin "Starting service scan ..." PATH="/usr/bin:$PATH" cd $SVCDIR start-stop-daemon --start --quiet --exec /usr/bin/svscan -- & echo $! > /var/run/svscan.pid eend $? } stop() { ebegin "Stopping service scan ..." start-stop-daemon --stop --quiet --pid /var/run/svscan.pid eend $? if [ -e ${SVCDIR}/* ] then ebegin "Stopping services ..." svc -dx ${SVCDIR}/* eend $? ebegin "Stopping service logging ..." svc -dx ${SVCDIR}/*/log eend $? fi } =======