Subject: [netatalk-admins] papd error:/dev/printer

From: Michael Berghaus <[email-masked]>
Date: Mon, 27 Jul 1998 22:26:07 +0200 (CEST)

Sorry, if this is a FAQ...

I try to print to a unix printer from a mac via papd (netatalk 1.3.3).

The SYSLOG says:
>Jul 27 21:53:41 mibsbox papd[1887]:lp_conn_unix connect /dev/printer: No
>such file or directory
>Jul 27 21:50:04 mibsbox papd[1849]: lp_print: lp_conn_unix: No such file
>or directory

OK, there _IS_ no /dev/printer (SuSE Linux 4.4) but as far as I understand
the manpage, papd should only forward the print job to the lpd spool
system...
Even, if I create a /dev/printer (as a file or device like /dev/null) with
permissions set to 777, SYSLOG says:
>Jul 27 21:53:41 mibsbox papd[1887]: lp_conn_unix connect /dev/printer:
>Connection refused
>Jul 27 21:53:41 mibsbox papd[1887]: lp_print: lp_conn_unix: Connection
>refused
>Jul 27 21:53:41 mibsbox papd[1842]: child 1887 done

So, what's wrong? Any hints?

Best 73 de
Michael
----------------------------------------------------------------
/dev/printer is "hardcoded" in include/atalk/paths.h:
/*
 * papd paths
 */
#define _PATH_PAPDPRINTCAP      "/etc/printcap"
#define _PATH_PAPDSPOOLDIR      "/usr/spool/lpd"
#define _PATH_DEVPRINTER        "/dev/printer"
                                ^^^^^^^^^^^^^^ 
and used in etc/papd/lp.c:
lp_conn_unix()
{
    int                 s;
    struct sockaddr_un  saun;

    if (( s = socket( AF_UNIX, SOCK_STREAM, 0 )) < 0 ) {
        syslog( LOG_ERR, "lp_conn_unix socket: %m" );
        return( -1 );
    }
    bzero( &saun, sizeof( struct sockaddr_un ));
    saun.sun_family = AF_UNIX;
    strcpy( saun.sun_path, _PATH_DEVPRINTER );
                          ^^^^^^^^^^^^^^^^^^^
    if ( connect( s, (struct sockaddr *)&saun,
            strlen( saun.sun_path ) + 2 ) < 0 ) {
        syslog( LOG_ERR, "lp_conn_unix connect %s: %m", saun.sun_path );
        close( s );
        return( -1 );
    }

    return( s );
}

My papd.conf:
Linux DeskWriter:\
	pr=tst:op=lp:

My printcap:
#
tst|linux test printer for appletalk:\
	:lp=/dev/tty8:\
	:sd=/var/spool/tst:\
	:lf=/var/spool/tst/log:\
	:af=/var/spool/tst/acct:\
	:mx#0:\
	:sh:

---

From: Andrew McNabb <[email-masked]>
Date: Mon, 27 Jul 1998 22:55:34 -0500 (CDT)

It is a FAQ.  You have LPRng.  Set papd.cony to say:
:pr="|/usr/bin/lpr -Plp"
if your printer is named lp.

> So, what's wrong? Any hints?

----------------------------------------------
                Andrew McNabb
             Argus Systems Group
          [email-masked]
----------------------------------------------
  I am an International Arms Trafficker!!!!!
http://online.offshore.com.ai/arms-trafficker/
----------------------------------------------