wow,
first time somebody is sharing my problems (I seem to be the only one
running daemons on the clients)
the "patch-3.6.26" will fix the lpq-problem. If you are using this
version (3.6.26) you might run into a second problem: some applications
complain about max_open filedescriptors (...)
As you are about to patch you might be interested in that one as well
(patch-max_open is a mail containing the code corrections)
Cheers
Christoph
John Harper schrieb:
>
> I recently upgraded from LPRng 3.6.22 to 3.6.26 due to the CERT
> advisory, and I've found one annoying difference. We have two user
> machines that funnel jobs to a third server machine; I have
> force_localhost set in the printcap.
> In 3.6.22 an
> lpq -Pcclaser
> would first show the (usually) empty local queue, and then show the
> remote queue where the jobs end up. In 3.6.26 you only see the local
> queue, although
> lpq -Pcclaser@server
> works.
>
> I reinstalled 3.6.22 on one user machine and the old behaviour returned,
> ie the 3.6.22 binaries were able to talk to the 3.6.26 lpd on the server and
> get the remote queue listing. So I gather that it's just the 3.6.26 local
> lpd that doesn't feel like asking the remote for info about the
> destination queue. This does not seem to change if I remove the
> force_localhost, ie the local lpq just checks the local queue, but not
> the remote.
>
> Is this a new feature (I can't seem to find any reference to it in the
> HOWTO, or CHANGES files) and is there some way to recover the old
> behaviour?
>
> Thanks,
>
> John Harper
> ------------------------------------
> Academic Computing Coordinator
> University of Toronto at Scarborough
> [EMAIL PROTECTED]
>
> -----------------------------------------------------------------------------
> YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
> The address you post from MUST be your subscription address
>
> If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
> or lprng-digest-requests) with the word 'help' in the body. For the impatient,
> to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
> with: | example:
> subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
> unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
>
> If you have major problems, send email to [EMAIL PROTECTED] with the word
> LPRNGLIST in the SUBJECT line.
> -----------------------------------------------------------------------------
--
/* Christoph Beyer | Office: Building 2b / 23 *\
* DESY | Phone: 040-8998-2317 *
* - IT - | Fax: 040-8998-4060 *
\* 22603 Hamburg | http://www.desy.de */
> Hi,
>
> after an upgrade from LPRng 3.6.22 to 3.6.26 at least two of our
> users have problems. They get an error message like
>
> Max_open:fd 34 and old Max_fd 19
>
> when they print from specific applications (ghostview and Acrobat
> Reader). Looking into the source it seems that this error message
> hasn't been in 3.6.22. What is it supposed to mean and what can we
> do about it? Any idea?
>
> Thanks,
>
> Robin
>
> P.S.: All on Solaris 2.6
>
> --
> Robin Sommer * private 05251/65041 * work 05251/60-3322
> Univers. of Paderborn * [EMAIL PROTECTED] * [EMAIL PROTECTED]
It was put into the code in order to track down problems with applications
that are closing all of the 'unused' file descriptors when they do
and execve( lpr ), or do not close file descriptors.
And it looks like we have a couple of culprits right here: ghostview and Acrobat
Reader.
This surfaced on a couple of systems when lpr got an 'out of file descriptor'
system level error... Needless to say, I was perturbed.
The 'Max_open()' code was put in to try and find out just how many file
descriptors were in use. I would use it to track the 'high water mark'
and the when I did an EXECVE I would close only the ones 'below'
the high water mark.
Here is the code:
void Max_open( int fd )
{
if( fd > 0 ){
if( fd > Max_fd+10 ){
FATAL(LOG_ERR) "Max_open: fd %d and old Max_fd %d", fd, Max_fd);
}
if( fd > Max_fd ) Max_fd = fd;
}
}
All you need to do is comment out the check...
void Max_open( int fd )
{
if( fd > 0 ){
#if 0
if( fd > Max_fd+10 ){
FATAL(LOG_ERR) "Max_open: fd %d and old Max_fd %d", fd, Max_fd);
}
#endif
if( fd > Max_fd ) Max_fd = fd;
}
}
But you might also send a flame to the ghostview and Acrobat folks...
Patrick Powell Astart Technologies,
[EMAIL PROTECTED] 9475 Chesapeake Drive, Suite D,
Network and System San Diego, CA 92123
Consulting 858-874-6543 FAX 858-279-8424
LPRng - Print Spooler (http://www.astart.com)
-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body. For the impatient,
to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
with: | example:
subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------
*** common/lpd_status.c 2000/08/19 20:36:06 5.17
--- common/lpd_status.c 2000/08/31 01:57:33
***************
*** 8,14 ****
***************************************************************************/
static char *const _id =
! "$Id: lpd_status.c,v 5.17 2000/08/19 20:36:06 papowell Exp $";
#include "lp.h"
--- 8,14 ----
***************************************************************************/
static char *const _id =
! "$Id: lpd_status.c,v 5.17 2000/08/19 20:36:06 papowell Exp papowell $";
#include "lp.h"
***************
*** 459,465 ****
Server_queue_name_DYN?"Server Printer":"Printer" );
}
len = strlen(header);
! SNPRINTF( header+len, sizeof(header)-len, "%s@%s ",
Printer_DYN, Report_server_as_DYN?Report_server_as_DYN:ShortHost_FQDN
);
if( safestrcasecmp( buffer, Printer_DYN ) ){
len = strlen(header);
--- 459,465 ----
Server_queue_name_DYN?"Server Printer":"Printer" );
}
len = strlen(header);
! SNPRINTF( header+len, sizeof(header)-len, "%s@%s",
Printer_DYN, Report_server_as_DYN?Report_server_as_DYN:ShortHost_FQDN
);
if( safestrcasecmp( buffer, Printer_DYN ) ){
len = strlen(header);
***************
*** 753,780 ****
"Get_queue_status: RemoteHost_DYN '%s', RemotePrinter_DYN '%s', Lp
'%s'",
RemoteHost_DYN, RemotePrinter_DYN, Lp_device_DYN );
- if( RemoteHost_DYN && RemotePrinter_DYN ){
- len = strlen( header );
- s = Frwarding(&Spool_control);
- if( displayformat == REQ_VERBOSE ){
- if( s ){
- SNPRINTF( header+len, sizeof(header)-len,
- "\n Forwarding: %s", s );
- } else {
- SNPRINTF( header+len, sizeof(header)-len,
- "\n Destination: %s@%s", RemotePrinter_DYN,
RemoteHost_DYN );
- }
- } else {
- if( s ){
- SNPRINTF( header+len, sizeof(header)-len,
- _("(forwarding %s)"), s );
- } else {
- SNPRINTF( header+len, sizeof(header)-len,
- _("(dest %s@%s)"), RemotePrinter_DYN, RemoteHost_DYN );
- }
- }
- }
-
if( displayformat != REQ_DSHORT ){
s = 0;
if( (s = Comment_tag_DYN) == 0 ){
--- 753,758 ----
***************
*** 862,896 ****
if( displayformat != REQ_VERBOSE ){
safestrncat( header, ") " );
}
! }
! if( Server_queue_name_DYN ){
len = strlen( header );
if( displayformat == REQ_VERBOSE ){
SNPRINTF( header+len, sizeof(header) - len,
! _("\n Serving: %s"), Server_queue_name_DYN );
} else {
SNPRINTF( header+len, sizeof(header) - len,
! _(" (serving %s)"), Server_queue_name_DYN );
}
}
! if( (s = Clsses(&Spool_control)) ){
len = strlen( header );
if( displayformat == REQ_VERBOSE ){
SNPRINTF( header+len, sizeof(header) - len,
! _("\n Classes: %s"), s );
} else {
SNPRINTF( header+len, sizeof(header) - len,
! _(" (classes %s)"), s );
}
}
! if( (s = Frwarding(&Spool_control)) ){
len = strlen( header );
if( displayformat == REQ_VERBOSE ){
SNPRINTF( header+len, sizeof(header) - len,
! _("\n Redirected_to: %s"), s );
} else {
SNPRINTF( header+len, sizeof(header) - len,
! _(" (redirect %s)"), s );
}
}
if( (Hld_all(&Spool_control)) ){
--- 840,883 ----
if( displayformat != REQ_VERBOSE ){
safestrncat( header, ") " );
}
! } else if( (s = Frwarding(&Spool_control)) ){
len = strlen( header );
if( displayformat == REQ_VERBOSE ){
SNPRINTF( header+len, sizeof(header) - len,
! _("\n Redirected_to: %s"), s );
} else {
SNPRINTF( header+len, sizeof(header) - len,
! _(" (redirect %s)"), s );
! }
! } else if( RemoteHost_DYN && RemotePrinter_DYN ){
! len = strlen( header );
! s = Frwarding(&Spool_control);
! if( displayformat == REQ_VERBOSE ){
! SNPRINTF( header+len, sizeof(header)-len,
! "\n Destination: %s@%s", RemotePrinter_DYN,
RemoteHost_DYN );
! } else {
! SNPRINTF( header+len, sizeof(header)-len,
! _(" (dest %s@%s)"), RemotePrinter_DYN, RemoteHost_DYN );
}
}
! if( Server_queue_name_DYN ){
len = strlen( header );
if( displayformat == REQ_VERBOSE ){
SNPRINTF( header+len, sizeof(header) - len,
! _("\n Serving: %s"), Server_queue_name_DYN );
} else {
SNPRINTF( header+len, sizeof(header) - len,
! _(" (serving %s)"), Server_queue_name_DYN );
}
}
! if( (s = Clsses(&Spool_control)) ){
len = strlen( header );
if( displayformat == REQ_VERBOSE ){
SNPRINTF( header+len, sizeof(header) - len,
! _("\n Classes: %s"), s );
} else {
SNPRINTF( header+len, sizeof(header) - len,
! _(" (classes %s)"), s );
}
}
if( (Hld_all(&Spool_control)) ){
***************
*** 1165,1171 ****
if( Find_fqdn( &LookupHost_IP, RemoteHost_DYN )
&& ( !Same_host(&LookupHost_IP,&Host_IP )
|| !Same_host(&LookupHost_IP,&Localhost_IP )) ){
! DEBUGF(DLPQ1)("Get_local_or_remote_status: doing local");
if( safestrcmp(RemotePrinter_DYN, Printer_DYN) ){
Set_DYN(&Printer_DYN,RemotePrinter_DYN);
Get_queue_status( tokens, sock, displayformat,
status_lines,
--- 1152,1158 ----
if( Find_fqdn( &LookupHost_IP, RemoteHost_DYN )
&& ( !Same_host(&LookupHost_IP,&Host_IP )
|| !Same_host(&LookupHost_IP,&Localhost_IP )) ){
! DEBUGF(DLPQ1)("Get_queue_status: doing local");
if( safestrcmp(RemotePrinter_DYN, Printer_DYN) ){
Set_DYN(&Printer_DYN,RemotePrinter_DYN);
Get_queue_status( tokens, sock, displayformat,
status_lines,
***************
*** 1176,1182 ****
Write_fd_str(*sock, msg );
}
} else {
! DEBUGF(DLPQ1)("Get_local_or_remote_status: doing remote %s@%s",
RemotePrinter_DYN, RemoteHost_DYN);
fd = Send_request( 'Q', displayformat, tokens->list,
Connect_timeout_DYN,
Send_query_rw_timeout_DYN, *sock );
--- 1163,1169 ----
Write_fd_str(*sock, msg );
}
} else {
! DEBUGF(DLPQ1)("Get_queue_status: doing remote %s@%s",
RemotePrinter_DYN, RemoteHost_DYN);
fd = Send_request( 'Q', displayformat, tokens->list,
Connect_timeout_DYN,
Send_query_rw_timeout_DYN, *sock );
***************
*** 1273,1283 ****
char *s, *t;
Init_line_list(&l);
Get_fd_image_and_split(fd,max_size,0,&l,Line_ends,0,0,0,0,0,0);
header[0] = 0;
last_printed = start = -1;
! for( i = 0; i < l.count; ++i ){
s = l.list[i];
/* find up to the first colon */
if( (t = safestrchr(s,':')) ){
--- 1260,1272 ----
char *s, *t;
Init_line_list(&l);
+ DEBUGF(DLPQ1)("Print_different_last_status_lines: status lines %d",
+status_lines );
Get_fd_image_and_split(fd,max_size,0,&l,Line_ends,0,0,0,0,0,0);
+ DEBUGFC(DLPQ1)Dump_line_list( "Print_different_last_status_lines", &l );
header[0] = 0;
last_printed = start = -1;
! if( status_lines > 0 ) for( i = 0; i < l.count; ++i ){
s = l.list[i];
/* find up to the first colon */
if( (t = safestrchr(s,':')) ){
***************
*** 1297,1308 ****
if( Write_fd_str(*sock,"\n") < 0 ) cleanup(0);
}
last_printed = i-1;
}
}
! start = i-status_lines;
if( start <= last_printed ) start = last_printed + 1;
! for( j = start; j < i; ++j ){
! if( Write_fd_str(*sock,l.list[j]) < 0 ) cleanup(0);
if( Write_fd_str(*sock,"\n") < 0 ) cleanup(0);
}
Free_line_list(&l);
--- 1286,1302 ----
if( Write_fd_str(*sock,"\n") < 0 ) cleanup(0);
}
last_printed = i-1;
+ DEBUGF(DLPQ1)("Print_different_last_status_lines: start %d,
+last_printed %d",
+ start, last_printed );
}
}
! if( status_lines > 0 ){
! start = l.count - status_lines;
! }
if( start <= last_printed ) start = last_printed + 1;
! DEBUGF(DLPQ1)("Print_different_last_status_lines: done, start %d", start );
! for( i = start; i < l.count ; ++i ){
! if( Write_fd_str(*sock,l.list[i]) < 0 ) cleanup(0);
if( Write_fd_str(*sock,"\n") < 0 ) cleanup(0);
}
Free_line_list(&l);