Commit 513947d6 authored by max's avatar max
Browse files

Added local hack to make youbind server detatch itself from the controling

tty at the startup.

Removed `&' from the startup script since youbind doesn't need to be
put background manually.
parent dcce4e46
......@@ -3,7 +3,7 @@
# Date created: 09 Aug 1996
# Whom: Masafumi NAKANE <max@FreeBSD.ORG>
#
# $Id: Makefile,v 1.4 1996/09/17 15:07:58 max Exp $
# $Id: Makefile,v 1.5 1996/09/18 19:20:24 max Exp $
#
DISTNAME= youbin-2.13
......@@ -21,19 +21,19 @@ PREFIX?= ${LOCALBASE}
STARTUP_SCRIPT= ${PREFIX}/etc/rc.d/youbind.sh
post-install:
@if [ ! -f ${STARTUP_SCRIPT} ]; then \
echo "Creating startup script '${STARTUP_SCRIPT}'" ;\
echo "#!/bin/sh" > ${STARTUP_SCRIPT} ;\
echo "if [ -f ${PREFIX}/sbin/youbind ]; then" >> \
${STARTUP_SCRIPT} ;\
echo " ${PREFIX}/sbin/youbind &" >> ${STARTUP_SCRIPT} ;\
echo " echo -n ' youbind'" >> ${STARTUP_SCRIPT} ;\
echo "fi" >> ${STARTUP_SCRIPT} ;\
chmod 755 ${STARTUP_SCRIPT} ;\
@if [ ! -f ${STARTUP_SCRIPT} ]; then \
echo "Creating startup script '${STARTUP_SCRIPT}'" ; \
echo "#!/bin/sh" > ${STARTUP_SCRIPT} ; \
echo "if [ -f ${PREFIX}/sbin/youbind ]; then" \
>> ${STARTUP_SCRIPT} ; \
echo " ${PREFIX}/sbin/youbind ; echo -n ' youbind'" \
>> ${STARTUP_SCRIPT} ; \
echo "fi" >> ${STARTUP_SCRIPT} ; \
chmod 755 ${STARTUP_SCRIPT} ; \
fi
@-(grep -v ^# /etc/inetd.conf | grep comsat > /dev/null) && \
@-(grep -v ^# /etc/inetd.conf | grep comsat > /dev/null) && \
(echo "Now you need to edit /etc/inetd.conf and comment out the" ;\
echo "entry for comsat. Then, do:" ;\
echo "entry for comsat. Then, do:" ; \
echo "kill -HUP `cat /var/run/inetd.pid`")
.include <bsd.port.mk>
diff -c server.c.orig server.c
*** server.c.orig Sun Mar 26 20:33:31 1995
--- server.c Wed Aug 7 13:47:05 1996
--- server.c Wed Oct 9 21:29:25 1996
***************
*** 48,53 ****
--- 48,56 ----
#include <pwd.h> /* For getpwuid(). */
#include <signal.h>
#include <stdio.h>
+ #ifdef __FreeBSD__
+ #include <stdlib.h>
+ #endif
#include "youbin.h"
#include "server.h"
***************
*** 154,159 ****
--- 157,171 ----
dummy.tv_sec = (long)(UNIT_TIME * 10);
dummy.tv_usec = 0L;
+ /*Go to background. This part was modified locally by Masafumi NAKANE
+ <max@wide.ad.jp>, and is used only on FreeBSD./*
+ #ifdef __FreeBSD__
+ if (daemon(1, 1) == -1) {
+ perror("daemon");
+ kill(getpid(), SIGTERM);
+ }
+ #endif
+
/* Dive into main loop. Don't use setjmp() and longjmp(),
because list maintenance routines are in critical section. */
alarm(UNIT_TIME);
***************
*** 244,250 ****
char buff[MESS_LEN + 1];
......@@ -10,7 +39,7 @@ diff -c server.c.orig server.c
if (errno != EINTR) {
warn_log("Error in receiving packet\n");
}
--- 244,250 ----
--- 256,262 ----
char buff[MESS_LEN + 1];
int len, flen = sizeof(ca);
......@@ -27,7 +56,7 @@ diff -c server.c.orig server.c
sys_error_log("bind");
exit(EXIT_FAILURE);
}
--- 543,549 ----
--- 555,561 ----
saddr->sin_family = hp->h_addrtype;
saddr->sin_addr.s_addr = htonl(INADDR_ANY);
saddr->sin_port = sp->s_port;
......@@ -44,7 +73,7 @@ diff -c server.c.orig server.c
warn_log("Error in sending packet: %s\n", mess);
}
}
--- 586,592 ----
--- 598,604 ----
debug_log("Send: %s [%ld]: \"%.*s\"\n",
((sp == CA_ADDR) ? "" : sp->parent->name), (long)sp,
MAX_DEBUG_COLUMN, mess);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment