From mi@rtfm.ziplink.net  Tue Oct 29 10:01:50 1996
Received: from rtfm.ziplink.net ([199.232.255.52])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id KAA13683
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 29 Oct 1996 10:01:44 -0800 (PST)
Received: (from root@localhost) by rtfm.ziplink.net (8.7.5/8.7.3) id MAA08993; Tue, 29 Oct 1996 12:59:10 -0500 (EST)
Message-Id: <199610291759.MAA08993@rtfm.ziplink.net>
Date: Tue, 29 Oct 1996 12:59:10 -0500 (EST)
From: mi@aldan.ziplink.net
Reply-To: mi@aldan.ziplink.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: lpc's output erroneous and confusing
X-Send-Pr-Version: 3.2

>Number:         1924
>Category:       bin
>Synopsis:       if lpd is not running, lpc will say ``no such file or directory''
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 29 10:10:01 PST 1996
>Closed-Date:    Sun Apr 26 03:19:13 PDT 1998
>Last-Modified:  Sun Apr 26 03:19:21 PDT 1998
>Originator:     Mikhail Teterin
>Release:        FreeBSD 2.2-960801-SNAP i386
>Organization:
>Environment:

	If lpd is not started, attempts to use ``lpc start lp'' will
	lead to :
		mi@rtfm:/mnt/root/invoice (128) lpc start lp
		lp:
			printing enabled
		lpc: connect: No such file or directory
			couldn't start daemon

	Instead of smth like: ``can not connect to lpd. Is it running?''
	Or even better: ``lpd not running. Try to start it (y/n)?''

>Description:

	See above

>How-To-Repeat:

	kill `ps -ax | grep lpd | awk '{print $1}'`
	lpc start lp

>Fix:
	
	Seems like lpc relies on errno routines to report errors (perror()?)
	If I am wrong -- this is just another evidence of how confusing
	this output really is ;)

	BTW, I reported a similar problem with route(8), when the sysadmin-
	-beginner would sometimes get an error output with "Disk quota
	exceeded" instead of whatever is wrong really. Either perror()
	and stuff need to be fixed (serious and correct solution?), or
	things like lpc and route need to process errors on their own
	(quickier and dirtier solution?).
	It is hard to appreciate the advanced features of FreeBSD with
	bugs like this -- bugs contributing to the myth, that Unix is
	hard to understand.
>Release-Note:
>Audit-Trail:

From: J Wunsch <j@uriah.heep.sax.de>
To: mi@aldan.ziplink.net
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/1924: lpc's output erroneous and confusing
Date: Tue, 29 Oct 1996 21:15:30 +0100 (MET)

 As mi@aldan.ziplink.net wrote:
 
 > 			printing enabled
 > 		lpc: connect: No such file or directory
 
 > 	Seems like lpc relies on errno routines to report errors (perror()?)
 
 It does.  To the used sysadmin (or programmer?), the little word
 `connect:' indicates the real source of the error: there's no local
 domain socket to connect to (i.e., /var/run/printer doesn't exist,
 hence "No such file or directory" is indeed appropriate).
 
 This might probably be re-worded, but i see it as very low priority.
 There are too many things of this kind, and it would probably bloat
 the source by quite some bits to special case all eventual meanings of
 various error messages.  (Apart from this, somebody must actually do
 it.)  perror() is fairly simple, while something like:
 
 	if (errno == ENOENT)
 		fprintf(stderr, "No server is running.\n");
 	else if (errno = EMUMBLE)
 		fprintf(stderr, "Some fooish must have happened.\n");
 	...
 	else
 		perror("connect");
 
 seems to be much effort.
 
 -- 
 cheers, J"org
 
 joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
 Never trust an operating system you don't have sources for. ;-)
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Sun Apr 26 03:19:13 PDT 1998 
State-Changed-Why:  
timed out 
>Unformatted:
