On Wed, Oct 12, 2011 at 7:03 AM, Pascal Stumpf <[email protected]>
wrote:
> I have two printers on the local network (laser and lexmark) and I want
> to use lpd(8) to print on them. It seems to me that lpd is having some
> sort of local problem (it does not even create lock and status files in
> the spool directories, and both lpr and lpq do not see the daemon). But
> some info first:
>
> lpd is started with -s, manually or with rc.d makes no difference (nor
> removing -s).
>
>
> /etc/printcap:
> #       $OpenBSD: printcap,v 1.4 2003/03/28 21:32:30 jmc Exp $
>
> #lp|local line printer:\
> #       :lp=/dev/lp:sd=/var/spool/output:lf=/var/log/lpd-errs:
>
> #rp|remote line printer:\
> #       :lp=:rm=printhost:rp=lp:sd=/var/spool/output:lf=/var/log/lpd-errs:
>
> lexmark|Lexmark:\
>        :sh:lp=:rm=lexmark:\
>        :sd=/var/spool/output/lexmark:\
>        :lf=/var/log/lpd-errs:
>
> laser|Laser:\
>        :sh:lp=:rm=laser:rp=raw:\
>        :sd=/var/spool/output/laser:\
>        :lf=/var/log/lpd-errs:

I am not an expert at this but I have similar set up but it is working
and I am not using -s option to lpd.

Here is what I have in my /etc/printcap (very similar to yours) and it
is working for me:

rp|speedy:\
        :lp=:\
        :rm=speedy:\
        :sh:\
        :rp=lp:\
        :sd=/var/spool/output:\
        :lf=/var/log/lpd-errs:

Note that whatever value you set for rm better resolve (e.g., you have
an entry for it in /etc/hosts) when you start up lpd.

--patrick


>
> Permissions:
> -r-xr-s---  1 root  daemon  72368 Oct 12 01:56 /usr/sbin/lpd
> -r-sr-sr-x  1 root  daemon  25104 Oct 12 01:56 /usr/bin/lpr
> -r-xr-sr-x  1 root  daemon  24656 Oct 12 01:56 /usr/bin/lpq
>
> srw-rw----  1 root  daemon  0 Oct 12 15:09 /var/run/printer
> drwxr-xr-x  28 root  wheel  512 Sep 26 21:27 /var
> drwxr-xr-x  13 root  wheel  512 Oct 12 15:09 /var/spool
> drwxrwxr-x  4 root  daemon  512 Oct 12 14:27 /var/spool/output
> drwxrwx---  2 root  daemon  512 Oct 12 15:10 /var/spool/output/lexmark
> drwxrwx---  2 root  daemon  512 Oct 12 14:27 /var/spool/output/laser
>
>
> ps -auwwx | grep lpd:
> daemon   29820  0.0  0.0   328   912 ??  Is     3:09PM    0:00.01 lpd -s
> pascal    8535  0.0  0.0   224   388 p3  R+/0   3:59PM    0:00.00 grep lpd
>
> ls -l /var/spool/output/lexmark:
> -rw-rw---x  1 daemon  daemon      4 Oct 12 15:10 .seq
> -rw-rw----  1 daemon  daemon    114 Oct 12 15:09 cfA004aias.local.cubes.de
> -rw-rw----  1 daemon  daemon    114 Oct 12 15:10 cfA005aias.local.cubes.de
> -rw-rw----  1 daemon  daemon  16000 Oct 12 15:09 dfA004aias.local.cubes.de
> -rw-rw----  1 daemon  daemon  16000 Oct 12 15:10 dfA005aias.local.cubes.de
>
> lptest | lpr -p: (with PRINTER=lexmark)
> jobs queued, but cannot start daemon.
>
> lpq:
> aias.local.cubes.de: Warning: no daemon present
> Rank   Owner      Job  Files                                 Total Size
> 1st    pascal     4    (standard input)                      16000 bytes
> 2nd    pascal     5    (standard input)                      16000 bytes
> 3rd    pascal     6    (standard input)                      16000 bytes
>
> No entries
>
>
> Ktracing the lpd process gives this when a job is submitted by lpr:
>  29820 lpd      EMUL  "native"
>  29820 lpd      RET   select 1
>  29820 lpd      CALL  accept(0x5,0x7f7ffffec060,0x7f7ffffebd48)
>  29820 lpd      STRU  struct sockaddr { AF_LOCAL, "" }
>  29820 lpd      RET   accept 6
>  29820 lpd      CALL  fork()
>  29820 lpd      RET   fork 15081/0x3ae9
>  29820 lpd      CALL  close(0x6)
>  29820 lpd      RET   close 0
>  29820 lpd      CALL  select(0x6,0x7f7ffffebc10,0,0,0)
>  29820 lpd      PSIG  SIGCHLD caught handler=0x403560 mask=0x0
>  29820 lpd      RET   select -1 errno 4 Interrupted system call
>  29820 lpd      CALL  wait4(0xffffffff,0x7f7ffffeb814,0x1<WNOHANG>,0)
>  29820 lpd      RET   wait4 15081/0x3ae9
>  29820 lpd      CALL  wait4(0xffffffff,0x7f7ffffeb814,0x1<WNOHANG>,0)
>  29820 lpd      RET   wait4 -1 errno 10 No child processes
>  29820 lpd      CALL  sigreturn(0x7f7ffffeb830)
>  29820 lpd      RET   sigreturn JUSTRETURN
>  29820 lpd      CALL  select(0x6,0x7f7ffffebc10,0,0,0)
>
> Trying to "restart all" via lpc:
> lexmark:
>        cannot open lock file
> lexmark:
>        couldn't start daemon
> laser:
>        cannot open lock file
> laser:
>        couldn't start daemon
>
> Daemon user:
> daemon:*:1:1:The devil himself:/root:/sbin/nologin
> uid=1(daemon) gid=1(daemon) groups=1(daemon)
>
>
> Of course I searched the web and mailing lists, but nothing really
> helped. The printcap entries have been verified to work on Linux (for
> laser) and FreeBSD (for lexmark).
>
> I'm sure what I'm missing is something very basic and simple, but I just
> can't seem to figure it out. Does anyone have an idea?
>
> --------
> New crypt.  See /usr/news/crypt.

Reply via email to