IPv6 and cvsup servers

Rudolf Cejka cejkar at fit.vutbr.cz
Mon Mar 31 03:30:41 PDT 2008


John Hay wrote (2008/03/31):
> I use socat on cvsup.za.freebsd.org. Something like:
> /usr/local/bin/socat -ly TCP6-LISTEN:5999,fork,reuseaddr TCP4:127.0.0.1:5999

Hello, cvsup.cz.FreeBSD.org should accept IPv6 cvsup connections too.
As a quick how-to for the others, you can put

--
#!/bin/sh

nohup /usr/local/bin/socat -ly \
  tcp6-listen:5999,fork,reuseaddr \
  tcp4:localhost:5999 >/dev/null 2>&1 &

--

into your /etc/rc.local, or patch socat with

--- socat.c.orig	Tue Mar  6 22:03:28 2007
+++ socat.c	Fri Mar  9 18:04:33 2007
@@ -280,7 +280,7 @@
 #endif /* WITH_MSGLEVEL <= E_DEBUG */
 
    /* not sure what signal should print a message */
-   Signal(SIGHUP, socat_signal);
+   Signal(SIGHUP, SIG_IGN);
    Signal(SIGINT, socat_signal);
    Signal(SIGQUIT, socat_signal);
    Signal(SIGILL, socat_signal);
@@ -1295,7 +1295,6 @@
       break;
    case SIGTERM:
       Warn1("exiting on signal %d", signum); break;
-   case SIGHUP:  
    case SIGINT:
       Notice1("exiting on signal %d", signum); break;
    }
--

and put socat into rc.local in a simpler form:

--
#!/bin/sh

/usr/local/bin/socat -ly \
  tcp6-listen:5999,fork,reuseaddr \
  tcp4:localhost:5999 &

--

The problem is that socat does not survive booting sequence, because
it received HUP signal, which terminates it by default.

Regards.

-- 
Rudolf Cejka <cejkar at fit.vutbr.cz> http://www.fit.vutbr.cz/~cejkar
Brno University of Technology, Faculty of Information Technology
Bozetechova 2, 612 66  Brno, Czech Republic


More information about the freebsd-hubs mailing list