Debian bug report logs - #1479
dip -k leaves lock file behind.

Package: netstd; Reported by: dhs@firefly.com; Done: "Peter Tobias" <tobias@server.et-inf.fho-emden.de>.

Message received at debian-bugs-done:


From server.et-inf.fho-emden.de!tobias Fri Oct 13 14:12:57 1995
Return-Path: <tobias@server.et-inf.fho-emden.de>
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0t3rPQ-000DEZC; Fri, 13 Oct 95 14:12 PDT
Received: from server.et-inf.fho-emden.de by pixar.com with SMTP id AA03004
  (5.67b/IDA-1.5 for debian-bugs-done-pipe@mongo.pixar.com); Fri, 13 Oct 1995 14:12:26 -0700
Received: by server.et-inf.fho-emden.de (5.65/DEC-Ultrix/4.3)
	id AA17317; Fri, 13 Oct 1995 22:03:15 +0100
Message-Id: <9510132103.AA17317@server.et-inf.fho-emden.de>
Subject: Re: Bug#1479: dip -k leaves lock file behind.
To: dhs@firefly.com, debian-bugs-done@pixar.com
Date: Fri, 13 Oct 1995 22:03:15 +0100 (MET)
From: "Peter Tobias" <tobias@server.et-inf.fho-emden.de>
Reply-To: tobias@et-inf.fho-emden.de
In-Reply-To: <m0sxGxp-0006TWC@firefly.com> from "David H. Silber" at Sep 25, 95 01:05:07 pm
X-Mailer: ELM [version 2.4 PL23]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 8bit
Content-Length: 1886      

David H. Silber wrote:
> Package: netstd
> Version: 1.16-1
> 
> I use dip to create a PPP connection to my service provider.  When I use
> ``dip -k'' to end the session, /var/lock/LCK..cua0 is left behind.

I was not able to reproduce the bug. Dip itself detects stale lockfiles
and ignores them. According to Dirk there seems to be a problem with
minicom which can't detect stale lockfiles (user != root). Each program
that uses ASCII lockfiles should be able to do this.

Anyway, here is a little program that might help you. Just install it
setuid root and restrict the access to the program with the group.

----- cut here -----
#!/usr/bin/perl
# this perl script must run setuid root. Use the group to restrict
# access to a group of people

# Return codes:
# 0  no lockfile or no tty specified
# 1  lockfile removed
# 2  lockfile in use
# 10 no valid ASCII lockfile

$lockdir = "/var/lock";

$tty = $ARGV[0];

unless ($tty =~ m/^(tty|cua)/) {
   print "You have to use something like \`ttyS0' or \`cua1'\n";
   exit 0;
}

unless (-r "$lockdir/LCK..$tty") {
   print "No valid lockfile for \`$tty' found\n";
   exit 0;
}

open(PID, "$lockdir/LCK..$tty");
  $pid = <PID>;
close(PID);

unless ($pid =~ /\s+\d/) {
   print "The lockfile is not a valid ASCII lock file!\n";
   exit 10;
}

chomp($pid);
$pid =~ s/\s//g;

if (-d "/proc/$pid") {
   print "The process with the pid $pid uses the lockfile.\n";
   exit 2;
}

# get around this tainted stuff
$tty =~ /^(.*)$/;
$ttty = $1;

unlink("$lockdir/LCK..$ttty")
  || die "can't remove lockfile: $!\n";
print "Lockfile \`$lockdir/LCK..$ttty' removed\n";
exit 1;


----- cut here -----

Peter

-- 
 Peter Tobias                                EMail:
 Fachhochschule Ostfriesland                 tobias@et-inf.fho-emden.de
 Fachbereich Elektrotechnik und Informatik   tobias@perseus.fho-emden.de
 Constantiaplatz 4, 26723 Emden, Germany

Notification sent to dhs@firefly.com:
Bug acknowledged by developer. Full text available.
Reply sent to tobias@et-inf.fho-emden.de:
You have taken responsibility. Full text available.

Message received at debian-bugs:


From qed.econ.queensu.ca!edd Tue Sep 26 10:38:02 1995
Return-Path: <edd@qed.econ.queensu.ca>
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0sxdx7-000G8mC; Tue, 26 Sep 95 10:37 PDT
Received: from post.QueensU.CA (knot.QueensU.CA) by pixar.com with SMTP id AA27903
  (5.67b/IDA-1.5 for debian-bugs-pipe@mongo.pixar.com); Tue, 26 Sep 1995 10:37:38 -0700
Received: from miles.econ.queensu.ca (free2-slip221.tele.QueensU.CA [130.15.126.221]) by post.QueensU.CA (8.6.12/8.6.10+ASH) with SMTP id NAA29990; Tue, 26 Sep 1995 13:36:50 -0400
Received: by miles.econ.queensu.ca
	id <m0sxdup-000160C@miles.econ.queensu.ca>
	(Debian /\oo/\ Smail3.1.29.1 #29.33); Tue, 26 Sep 95 13:35 EDT
Message-Id: <m0sxdup-000160C@miles.econ.queensu.ca>
Date: Tue, 26 Sep 95 13:35 EDT
To: tobias@et-inf.fho-emden.de, debian-bugs@pixar.com
Cc: dhs@firefly.com, debian-bugs@pixar.com
In-Reply-To: <9509261603.AA05702@server.et-inf.fho-emden.de> (tobias@server.et-inf.fho-emden.de)
Subject: Re: Bug#1479: dip -k leaves lock file behind.
From: Dirk.Eddelbuettel@qed.econ.queensu.ca


[Sorry for replying late but the RS/6000 that collects my mail refused to
receive mail for about 28 h; this seems to be fixed now.]

  Peter Tobias writes:
  Peter>  David H. Silber wrote:
  >> I use dip to create a PPP connection to my service provider.  When I use
  >> ``dip -k'' to end the session, /var/lock/LCK..cua0 is left behind.
  Peter>  Can anybody confirm this? It works for me (I'm using slip to create
  Peter> an SLIP/CSLIP connection) and the source code contains a valid
  Peter> unlink call.  BTW: Do you use a (uu)getty on that line?

I think it is more subtle than this. 'dip -k' removes the link if you
terminate a proper connection properly. On the other hand, I often dial when
the lines are busy and have to abort the loop that dip executes from its 
script with CTRL-C. A subsequent 'dip -k' does _not_ remove the lock, I have
to change hats and become root to remove it. Annoying.

-- 
Dirk.Eddelbuettel@qed.econ.queensu.ca         http://qed.econ.queensu.ca/~edd

Acknowledgement sent to Dirk.Eddelbuettel@qed.econ.queensu.ca:
Extra info received and forwarded. Full text available.
Information forwarded to debian-devel@pixar.com:
Bug#1479; Package netstd. Full text available.

Message received at debian-bugs:


From server.et-inf.fho-emden.de!tobias Tue Sep 26 09:13:13 1995
Return-Path: <tobias@server.et-inf.fho-emden.de>
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0sxcd3-000GX3C; Tue, 26 Sep 95 09:13 PDT
Received: from server.et-inf.fho-emden.de by pixar.com with SMTP id AA23902
  (5.67b/IDA-1.5 for debian-bugs-pipe@mongo.pixar.com); Tue, 26 Sep 1995 09:11:45 -0700
Received: by server.et-inf.fho-emden.de (5.65/DEC-Ultrix/4.3)
	id AA05702; Tue, 26 Sep 1995 17:03:31 +0100
Message-Id: <9509261603.AA05702@server.et-inf.fho-emden.de>
Subject: Re: Bug#1479: dip -k leaves lock file behind.
To: dhs@firefly.com, debian-bugs@pixar.com
Date: Tue, 26 Sep 1995 17:03:30 +0100 (MET)
From: "Peter Tobias" <tobias@server.et-inf.fho-emden.de>
Reply-To: tobias@et-inf.fho-emden.de
In-Reply-To: <m0sxGxp-0006TWC@firefly.com> from "David H. Silber" at Sep 25, 95 01:05:07 pm
X-Mailer: ELM [version 2.4 PL23]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 8bit
Content-Length: 644       

David H. Silber wrote:
> Package: netstd
> Version: 1.16-1
> 
> I use dip to create a PPP connection to my service provider.  When I use
> ``dip -k'' to end the session, /var/lock/LCK..cua0 is left behind.

Can anybody confirm this? It works for me (I'm using slip to create an
SLIP/CSLIP connection) and the source code contains a valid unlink call.
BTW: Do you use a (uu)getty on that line?


Peter

-- 
 Peter Tobias                                EMail:
 Fachhochschule Ostfriesland                 tobias@et-inf.fho-emden.de
 Fachbereich Elektrotechnik und Informatik   tobias@perseus.fho-emden.de
 Constantiaplatz 4, 26723 Emden, Germany

Acknowledgement sent to tobias@et-inf.fho-emden.de:
Extra info received and forwarded. Full text available.
Information forwarded to debian-devel@pixar.com:
Bug#1479; Package netstd. Full text available.

Message received at debian-bugs:


From uu5.psi.com!firefly!dhs Mon Sep 25 11:28:25 1995
Return-Path: <firefly!dhs@uu5.psi.com>
Received: from pixar.com by mongo.pixar.com with smtp
	(Smail3.1.28.1 #15) id m0sxIGP-000DW6C; Mon, 25 Sep 95 11:28 PDT
Received: from uu5.psi.com by pixar.com with SMTP id AA27872
  (5.67b/IDA-1.5 for debian-bugs-pipe@mongo.pixar.com); Mon, 25 Sep 1995 11:28:06 -0700
Received: from firefly.UUCP by uu5.psi.com (5.65b/4.0.071791-PSI/PSINet) via UUCP;
        id AA09922 for ; Mon, 25 Sep 95 14:19:33 -0400
Received: by firefly.com
	id m0sxGxp-0006TWC
	(Debian /\oo/\ Smail3.1.29.1 #29.27); Mon, 25 Sep 95 13:05 EDT
Message-Id: <m0sxGxp-0006TWC@firefly.com>
From: dhs@firefly.com (David H. Silber)
Subject: dip -k leaves lock file behind.
To: debian-bugs@pixar.com
Date: Mon, 25 Sep 1995 13:05:07 -0400 (EDT)
Reply-To: dhs@firefly.com
X-Mailer: ELM [version 2.4 PL24]
Content-Type: text
Content-Length: 350       

Package: netstd
Version: 1.16-1

I use dip to create a PPP connection to my service provider.  When I use
``dip -k'' to end the session, /var/lock/LCK..cua0 is left behind.

-- 
  David H. Silber     dhs@firefly.com     Project: Debian GNU/Linux (dbackup)
  <http://www.access.digex.net/~dhs/>     Wanted:  Spare time.

			     Programmer for hire.


Acknowledgement sent to dhs@firefly.com:
New bug report received and forwarded. Full text available.
Report forwarded to debian-devel@pixar.com:
Bug#1479; Package netstd. Full text available.
Ian Jackson / iwj10@thor.cam.ac.uk, with the debian-bugs tracking mechanism
This page last modified 07:43:01 GMT Wed 01 Nov