'dip' doesn't terminate...

'dip' doesn't terminate...

Post by Karl Keyte, ESOC Darmstad » Fri, 03 Dec 1993 01:15:05

I have my machine (0.99.13s) set up as a SLIP server.  Everything
works like a dream except that my 'dip' doesn't terminate and give
control back to the 'getty' which is listening for connections.
This means that only one connect is possible and after that has
gone, nothing else works until I 'kill -9' the dip program.

I have a 'slip' login in the password file which runs a shell to
invoke 'dip -i'.  That's all.  Seems that `dip' simply doesn't see
the remote hang-up.

PLEASE help - I'm sure I'm just doing something stupid!



'dip' doesn't terminate...

Post by Karl Keyte, ESOC Darmstad » Wed, 08 Dec 1993 00:29:19


>>: This sounds like a strange question :-) ... but having had successfully
>>: established a SLIP connection, how does one *gracefully* terminate it?
>>: I didn't see anything about this in the FAQs, only how to INITIATE the
>>: connection.  Doing an "ifconfig sl0 down" didn't work, nor did
>>: power-cycling the modem (broke the connection of course, but the kernel
>>: still thought the modem port was busy).

>>: Thanks,
>>: Bill

>>If you are using `dip' then check out `dip -k'. This will kill the
>>dip process that is handling the slip connection for you.

But this is something else...this is how to kill 'dip' from the CLIENT
end.  My original question was how to make the SERVER 'dip' go away when
there was a hang-up.  [See below]

Quote:>Here's a patch I've found useful; it makes "dip" go away when the carrier
>drops on the serial line (effectively shutting down sl0).

It's not really the CD line surely...this would mean that a short
interruption to the carrier would kill the session.  Error correction
stuff to protect data transfers would be useless against this.  Not
a bad approach though, but see further on...

Quote:>It does so by making the serial line the controlling terminal for the
>"dip" daemon.  This which really should be the behaviour anyway, since all
>dip does sitting around as a daemon is wait for the line to drop.  The only
>way it'll see the line drop, is if it get's the SIGHUP, which it'll only
>do if it has the serial line as it's controlling terminal.

>Here's the patch (line numbers might be a bit off, due to other mods I've
>made to p_slip):

>*** p_slip.c.orig       Fri Sep 10 12:46:59 1993
>--- p_slip.c    Fri Sep 10 12:49:47 1993
>*** 281,286 ****
>--- 281,287 ----
>    if (fd != 0) {
>        daemon(0, 0);
>    }
>+   ioctl(sl_fd, TIOCSCTTY, 1);

>    tty_lock(var_port);

>This requires dip to run setuid root (which I found I had to anyway).

Yeah - I found I had to do that because 'dip' needs to change the routing
tables when in succeeds.

Anyway, the real problem was that 'dip' WASN'T the controlling process
when I used the recommended server program:

int main()
   system("dip -i");


That kicks off three processes, '-dip-i' (the above program), 'sh' (the
shell from the 'system' call and 'dip -i' (the real 'dip' program).  Only
the first is* on the serial line so the real 'dip' never sees the
SIGHUP signal.  I changed the above program to:

int main()
   execlp("dip", "dip", "-i", (char *)0);


And it all works like a dream, handing control back to 'getty' when 'dip'
finishes.  Saves you two processes too!

Good luck, fellow SLIP-Servers!



1. Misterious behavior of 'dip' and 'find', help if u can...

Whenever I try to use dip , i receive one and the same answer "You don't exist
.Go away!", no matter what configurations or options I use.I think its someones
joke, and i simply should delete present dip package and get another one.Give
me any clue to this problem.
When I try to use find with some expressions it refuses to execute and shows
me how to use it.For instanse 'find / -name *dip*' does not work, while 'find /
-name *root*' works fine.Other expressions that find refuses to work with are
'*host*' , '*pid*'.

2. Newbie Question on Security???

3. ping -g 'gateway-IP' 'host-IP' DOESN'T work!

4. pwd as shell prompt

5. 'ping' sees route but 'telnet' doesn't??

6. stupid w2k box

7. cvsup doesn't like tags 'ports-all' & 'doc-all'

8. CNews setup for local news only

9. Bash 'umask' builtin doesn't set 'x' permissions?

10. 'ppp-on' Works, 'ifup ppp0' Doesn't

11. 'who' doesn't know who's logged in

12. mmap'd file ends with '!', copy doesn't

13. DIP 'bug' Can't read zeros in IP adr.