Using BSD printing tools

Mark Bartelt sysmark at physics.utoronto.ca
Tue Feb 12 07:05:30 AEST 1991


In article <11466 at helios.TAMU.EDU>
byron at archone.tamu.edu (Byron Rakitzis) writes:

> I'm configuring the BSD printing programs  [ ... ]  [W]hen
> I try to print a job, I get the following:

>	lpr: connect: Connection refused
>	jobs queued, but cannot start daemon.

> Does anyone know what the problem may be?

Through one of those amazing cosmic coincidences, I stumbled upon the very
same problem this morning, shortly before reading the above-quoted article.
The fix is trivial, once you've diagnosed the cause.  The problem is due to
an interaction between two things ...

---------------

(1)  Unlike every other flavour of UNIX I've encountered, IRIX exhibits the
following behaviour:

$ cd somewhere
$ ls -l abc xyz
l---------   1 zippy    sys            5 Feb 11 09:40 abc -> ./xyz
-rwxr-xr-x   2 zippy    sys        36392 Feb 11 13:07 xyz
$ abc &
1234
$ ps
   666 ttyq10    0:03 sh
  1234 ttyq10    0:00 xyz   <<=== Oh, yeah?
  1235 ttyq10    0:00 ps

In other words, even though argv[0] is "abc", the process's u.u_comm gets
"xyz" stuffed into it.  All the other UNIXes I have access to (both 4BSD
and System V based) report "abc" as the command name if "xyz" is an a.out;
if "xyz" is a shell script, some UNIXes report "abc", others report "sh".
IRIX is the only one that reports "xyz" when "abc" is run.

Whether this is a bug, misfeature, or (justifiable) design decision on SGI's
part, I have no idea.

---------------

(2)  With this in mind, we take a look in /etc/rc2.d, where we find something
like the following:

$ ls -l /etc/rc2.d/*lpd
l---------   1 root     sys          286 Feb  1 09:05 S60lpd -> /etc/init.d/lpd

This in itself wouldn't be a problem, were it not for the situation described
in (1) above, combined with what /etc/init.d/lpd actually does:

$ cat /etc/init.d/lpd
[ ... ]
case "$1" in
  'start')
	/etc/killall lpd
[ ...]

So, when /etc/rc2.d/S60lpd gets invoked at the appropriate time, /etc/killall
thinks its name is 'lpd' and kills it before the script has a chance to start
the printer daemon.

---------------

Fix:  Just remove the symlink in /etc/rc2.d, and replace it with a hard link.

It seems rather surprising that nobody has noted this problem already.  Maybe
Byron and I haven't been paying close attention to the postings of late?  Or
perhaps everyone else who's stumbled across the problem has just silently made
the obvious fix, without bothering to report it.

--

Mark Bartelt                                                     416/978-5619
Canadian Institute for                               sysmark at cita.toronto.edu
Theoretical Astrophysics                             sysmark at cita.utoronto.ca



More information about the Comp.sys.sgi mailing list