1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-21 20:38:45 +00:00

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.
This commit is contained in:
Masafumi Max NAKANE 1996-10-09 12:50:55 +00:00
parent 74b52e0ea2
commit 19c1794ba2
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=3942
2 changed files with 46 additions and 17 deletions

View File

@ -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
@ -24,10 +24,10 @@ 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 "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

View File

@ -1,6 +1,35 @@
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);