Return to BSD News archive
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!news.kei.com!ddsw1!not-for-mail
From: chilton@MCS.COM (Christopher Hilton)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Auto-killing slattach?
Date: 23 Jun 1995 17:06:56 -0500
Organization: /usr/lib/news/organi[sz]ation
Lines: 90
Message-ID: <3sfdu1$os4@Mars.mcs.com>
References: <kientzleDAJ8zB.FHo@netcom.com> <3sbiuf$t73@bonnie.tcd-dresden.de> <3sfa4t$n32@solaris.cc.vt.edu> <3sfbvf$q3i@agate.berkeley.edu>
NNTP-Posting-Host: mars.mcs.com
In article <3sfbvf$q3i@agate.berkeley.edu>,
Nick Kralevich <nickkral@parker.EECS.Berkeley.EDU> wrote:
>In article <3sfa4t$n32@solaris.cc.vt.edu>,
>Yuval Zalkow <yzalkow@fox.ee.vt.edu> wrote:
>>and an easy command to kill it is something like this:
>>
>>kill `ps -aux | grep slattach | grep -v grep | cut -c10-14`
>
>Easy? You must have a differnet definition of "easy" than I do. :)
>
>Try somthing like:
>
> killall slattach
>
>Which effectively does the same thing.
>
>Take care,
>-- Nick Kralevich
> nickkral@cory.eecs.berkeley.edu
>
>--
>LINUX, the FREE | University of California at | Nick Kralevich
>Operating System of the | Berkeley. Department of | nickkral@cory.eecs.
>future available via anon | Electrical Engineering and | berkeley.edu
>FTP. Ask me about it. | Computer Science. | finger for PGP
There are several bugs in the version of slattach that shipped with
2.0R. One Idea is to get the latest slattach from ftp.cdrom.com. The
latest one stores the pid of the slattach process for each invocation
in /var/run. If you are trying to kill the slattach program this
comes in handy as you can do something like:
kill `cat /var/run/slattach.cua00`
While not as short and sweet as Nick's suggestion it does have the
advantage of only killing the slattach process connected to a
particular terminal. Blythly killing all the slattach daemons on my
home box for example would not only disconnect me from the net but it
would also disconnect my laptop.
To get this program ftp to ftp.cdrom.com and go into
/pub/FreeBSD/current/src/sbin
ftp.cdrom.com runs wu-ftpd so you can just get slattach.tar.gz from
this directory (if I got it right) and you'll get the whole
source.
On a side note:
One problem with the slattach command is that on exit it is not
possible for it to clean up the interface:
ifconfig sl(unit) delete
So if you are using more than one slip interface you can occasionally
get hung up with a configuration where multiple interfaces have
exactly the same address information e.g.:
$ ifconfig sl0
sl0: flags=c011<UP,POINTTOPOINT,LINK2,MULTICAST> mtu 1006
inet 192.168.133.2 --> 192.168.133.3 netmask 0xffffff00
$ ifconfig sl1
sl1: flags=c011<UP,POINTTOPOINT,LINK2,MULTICAST> mtu 1006
inet 192.168.133.2 --> 192.168.133.3 netmask 0xffffff00
Needless to say this confuses routed to no end and in general doesn't
work. It would be nice if the exit shell script (slattach's -e
option) got an argument of the unit number that slattach was last
using as the interface so the athe tail end of the script could do
something like this:
# Delete the interface.
ifconfig sl$1 delete
This is a similar mechanism to the -u unit command. The only reason
that I hadn't said something before is because I doubted that many
people are using more than one slip unit at a time.
C.
--
Christopher Sean Hilton E-mail: chilton@mcs.com
----------------------------------------------------------------------
ICBM address: | "Thus it is said if you know them and know
42 07 39 N/87 49 44 W | yourself, your victory will not be imperiled.
For PGP key finger: | If you know Heaven and you know Earth, your
chilton@mcs.com | victory will be complete." - Sun Tsu
----------------------------------------------------------------------