Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 71620 Details for
Bug 102866
sys-process/daemontools: svscan with readproctitle support
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Drop-in replacement for /usr/bin/svscan in /etc/init.d/svscan
svscan-start.patch (text/plain), 5.46 KB, created by
Tullio Andreatta
on 2005-10-28 02:58:06 UTC
(
hide
)
Description:
Drop-in replacement for /usr/bin/svscan in /etc/init.d/svscan
Filename:
MIME Type:
Creator:
Tullio Andreatta
Created:
2005-10-28 02:58:06 UTC
Size:
5.46 KB
patch
obsolete
>diff -ruN /usr/portage/sys-process/daemontools/daemontools-0.76-r4.ebuild daemontools/daemontools-0.76-r4.ebuild >--- /usr/portage/sys-process/daemontools/daemontools-0.76-r4.ebuild 2005-03-03 19:11:26.000000000 +0100 >+++ daemontools/daemontools-0.76-r4.ebuild 2005-10-28 12:31:16.000000000 +0200 >@@ -25,6 +25,11 @@ > epatch ${FILESDIR}/${PV}-errno.patch > epatch ${FILESDIR}/${PV}-head-1.patch > >+ # adding svscan-start >+ einfo "Adding svscan-start command ..." >+ cat >${S}/src/svscan-start.c ${FILESDIR}/svscan-start.c >+ cat >>${S}/src/Makefile ${FILESDIR}/svscan-start-Makefile >+ > use static && LDFLAGS="${LDFLAGS} -static" > > echo "$(tc-getCC) ${CFLAGS}" > src/conf-cc >@@ -34,7 +39,7 @@ > > src_compile() { > cd ${S}/src >- emake || die "make failed" >+ emake svscan-start it || die "make failed" > } > > src_install() { >@@ -44,13 +49,13 @@ > einfo "Installing package ..." > cd ${S}/src > exeinto /usr/bin >- for x in `cat ../package/commands` ; do >+ for x in `cat ../package/commands` svscan-start; do > doexe $x || die > done > > dodoc CHANGES ../package/README TODO > >- newinitd ${FILESDIR}/svscan-0.76-r4 svscan >+ newinitd ${FILESDIR}/svscan-start-0.76-r4 svscan > } > > pkg_postinst() { >diff -ruN /usr/portage/sys-process/daemontools/files/svscan-start-0.76-r4 daemontools/files/svscan-start-0.76-r4 >--- /usr/portage/sys-process/daemontools/files/svscan-start-0.76-r4 1970-01-01 01:00:00.000000000 +0100 >+++ daemontools/files/svscan-start-0.76-r4 2005-10-28 12:18:00.000000000 +0200 >@@ -0,0 +1,36 @@ >+#!/sbin/runscript >+# Copyright 1999-2004 Gentoo Foundation >+# Distributed under the terms of the GNU General Public License v2 >+# $$ >+ >+depend() { >+ need net >+ after net >+ before ntpd ntp-client >+ before spamd >+ before apache apache2 >+} >+ >+start() { >+ ebegin "Starting service scan" >+ ( >+ # workaround for #25754 >+ unset -f `declare -F | sed 's:declare -f::g'` >+ PATH="/usr/bin:$PATH" >+ start-stop-daemon --start --quiet --exec /usr/bin/svscan-start --pidfile /var/run/svscan.pid -- /service & >+ echo $! > /var/run/svscan.pid >+ ) >+ eend $? >+} >+ >+stop() { >+ ebegin "Stopping service scan" >+ start-stop-daemon --stop --quiet --pidfile /var/run/svscan.pid >+ eend $? >+ ebegin "Stopping services" >+ svc -dx /service/* 2>/dev/null >+ eend $? >+ ebegin "Stopping service logging" >+ svc -dx /service/*/log 2>/dev/null >+ eend $? >+} >diff -ruN /usr/portage/sys-process/daemontools/files/svscan-start-Makefile daemontools/files/svscan-start-Makefile >--- /usr/portage/sys-process/daemontools/files/svscan-start-Makefile 1970-01-01 01:00:00.000000000 +0100 >+++ daemontools/files/svscan-start-Makefile 2005-10-24 19:02:13.000000000 +0200 >@@ -0,0 +1,10 @@ >+ >+svscan-start: byte.a load svscan-start.o unix.a >+ ./load svscan-start unix.a byte.a >+ >+svscan-start.o: byte.h coe.h compile direntry.h env.h error.h fd.h \ >+pathexec.h str.h strerr.h svscan-start.c wait.h >+ ./compile svscan-start.c >+ >+svscan-start-clean: >+ rm -f svscan-start svscan-start.o >diff -ruN /usr/portage/sys-process/daemontools/files/svscan-start.c daemontools/files/svscan-start.c >--- /usr/portage/sys-process/daemontools/files/svscan-start.c 1970-01-01 01:00:00.000000000 +0100 >+++ daemontools/files/svscan-start.c 2005-10-28 12:25:14.000000000 +0200 >@@ -0,0 +1,82 @@ >+#include <unistd.h> >+#include <sys/types.h> >+#include <sys/stat.h> >+#include "strerr.h" >+#include "error.h" >+#include "wait.h" >+#include "coe.h" >+#include "fd.h" >+#include "env.h" >+#include "sig.h" >+#include "str.h" >+#include "byte.h" >+#include "pathexec.h" >+ >+#define FATAL "svscan-start: fatal: " >+ >+#define DOTS \ >+"........................................................................" \ >+"........................................................................" \ >+"........................................................................" \ >+"........................................................................" \ >+"........................................................................" >+ >+int main(int argc,char **argv) >+{ >+ int pi[2]; >+ const char *args[5]; >+ char *fn; >+ int child; >+ int r; >+ int wstat; >+ >+ fn = argv[0] && argv[1] ? argv[1] : "/service"; >+ >+ if (pipe(pi) == -1) >+ strerr_die4sys(100,FATAL,"unable to create pipe for svscan ",fn,": "); >+ >+ switch(child = fork()) { >+ case -1: >+ strerr_die4sys(111,FATAL,"unable to fork for readproctitle ",fn,": "); >+ return; >+ case 0: >+ coe(pi[1]); >+ if (fd_move(0,pi[0]) == -1) >+ strerr_die4sys(111,FATAL,"unable to set up descriptors for readproctitle ",fn,": "); >+ >+ sig_block(sig_hangup); >+ sig_block(sig_int); >+ sig_block(sig_alarm); >+ sig_block(sig_term); >+ >+ args[0] = "readproctitle"; >+ args[1] = fn; >+ args[2] = ":"; >+ args[3] = DOTS; >+ args[4] = 0; >+ pathexec_run(*args,args,environ); >+ strerr_die2sys(111,FATAL,"unable to start readproctitle: "); >+ default: >+ sleep(2); >+ for (;;) { >+ r = wait_nohang(&wstat); >+ if (!r) break; >+ if (r == -1) { >+ if (errno == error_intr) continue; /* impossible */ >+ break; >+ } >+ >+ if (child == r) >+ strerr_die2x(111,FATAL,"readproctitle child died"); >+ } >+ } >+ >+ if (fd_move(2,pi[1]) == -1) >+ strerr_die4sys(111,FATAL,"unable to set up descriptors for svscan ",fn,": "); >+ >+ args[0] = "svscan"; >+ args[1] = fn; >+ args[2] = 0; >+ pathexec_run(*args,args,environ); >+ strerr_die4sys(111,FATAL,"unable to start svscan ",fn,": "); >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 102866
:
66143
|
66284
| 71620