Solved lpd not starting...

I have lpd_enable='YES' in rc.conf but I'm having difficulty printing. I've notice that if I restart the printing subsystem it say there is no daemon running:

Code:
root@pr5:/var/spool/lpd/lp # lpc restart all
lp:
    no daemon to abort
    printing enabled
    daemon restarted
root@pr5:/var/spool/lpd/lp # lpc restart all
lp:
    no daemon to abort
    printing enabled
    daemon restarted
root@pr5:/var/spool/lpd/lp #

How do I diagnose this issue? Thanks.
 
Check if it is running after boot ( # ps -ax | grep lpd ). If not, check /var/log/messages for relevant messages and try to start it manually from a terminal ( # /usr/sbin/lpd) to see if it shows an error.
 
In addition to the suggestions made by Tieks, please show us the contents of /etc/printcap:
Code:
grep -v "^#" /etc/printcap
Also please verify that cups has not polluted your lpr/lpd name space:
Code:
find / -mount -name lpc 2>/dev/null
which lpc
If your lpc is being executed out of /usr/local/sbin/lpc, cups(1) has usurped lpr/lpd.
 
Well, overnight, I've been busy. I found that I could get an old Deskjet working via its USB port, so I'm using that in the interim. So it appears that the daemon wasn't running because of the old setup in printcap. More details when I get Samba going again.
 
I've now repaired Samba. I suspect that Cups killed it, because installing Cups is the only thing I've installed recently. Anyroadup this is the existing printcap:
# @(#)printcap 5.3 (Berkeley) 6/30/90
# $FreeBSD$
# added by MG Nov 2022
#lp|printer|default|Brother HL-2150N:lp=:rm=192.168.0.11:rp=brother:\
#sd=/var/spool/brother:if=/usr/local/libexec/broif:\

# check after changes with #chkprintcap
# also NB the extra colon and tab on line breaks
#lp|printer|default|Brother HL-2150N:\
# :lp=:\
# :rm=192.168.0.13:\
# :rp=brother:\
# ??\
# :mx#0:\
# :sd=/var/spool/lpd/lp:\
# :lf=/var/log/lpd-errs:\
# :if=/usr/local/libexec/broif:
lp:lp=/dev/unlpt0:sh:mx#0:sd=/var/spool/lpd/lp:lf=/var/log/lpd-errs:if=/usr/local/libexec/hpif:

# :if/usr/local/libexec/broif:

# ghostscript driver shamelessly stolen from netbsd
#ps|Ghostscript driver:lp=:rm=192.168.0.11:rp=brother:sh:mx#0:\
#sd=/var/spool/lps/ps:lf=/var/log/lpd-errs:if=/usr/local/libexec/lpfilter-ps:
#
#

You can see various attempts at getting printing working, which now works via the USB interface to the Deskjet.
 
Cups installs its own emulators of the lpr/lpd utilities (plus some System V lp emulators) in the /usr/local tree:
Code:
[f13.148] $ ls -lad /usr/local/*bin/lp*
-rwxr-xr-x  1 root  wheel   18448 May 31  2022 /usr/local/bin/lp
-r-xr-xr-x  1 root  wheel  613392 Aug 26  2021 /usr/local/bin/lp_solve
-rwxr-xr-x  1 root  wheel   15936 May 31  2022 /usr/local/bin/lpoptions
-rwxr-xr-x  1 root  wheel   15776 May 31  2022 /usr/local/bin/lpq
-rwxr-xr-x  1 root  wheel   14848 May 31  2022 /usr/local/bin/lpr
lrwxr-xr-x  1 root  wheel       3 May 31  2022 /usr/local/bin/lpr-cups -> lpr
-rwxr-xr-x  1 root  wheel    9240 May 31  2022 /usr/local/bin/lprm
-rwxr-xr-x  1 root  wheel    5470 Jan 10 12:20 /usr/local/bin/lprsetup.sh
-rwxr-xr-x  1 root  wheel   31192 May 31  2022 /usr/local/bin/lpstat
-rwxr-xr-x  1 root  wheel   28424 May 31  2022 /usr/local/sbin/lpadmin
-rwxr-xr-x  1 root  wheel   11856 May 31  2022 /usr/local/sbin/lpc
-rwxr-xr-x  1 root  wheel   12816 May 31  2022 /usr/local/sbin/lpinfo
-rwxr-xr-x  1 root  wheel   10680 May 31  2022 /usr/local/sbin/lpmove
The BSD lpr/lpd utilities live in /usr:
Code:
[f13.149] $ ls -lad /usr/*bin/lp*     
-r-xr-xr-x  1 root  wheel    2720 Apr  9  2021 /usr/bin/lp
-r-sr-sr-x  1 root  daemon  36184 May 26  2022 /usr/bin/lpq
-r-sr-sr-x  1 root  daemon  40392 May 26  2022 /usr/bin/lpr
-r-sr-sr-x  1 root  daemon  33400 May 26  2022 /usr/bin/lprm
-r-xr-sr-x  1 root  daemon  60736 May 26  2022 /usr/sbin/lpc
-r-xr-xr-x  1 root  wheel   90696 May 26  2022 /usr/sbin/lpd
-r-xr-xr-x  1 root  wheel    6968 May 26  2022 /usr/sbin/lptcontrol
-r-xr-xr-x  1 root  wheel    6608 May 26  2022 /usr/sbin/lptest
That makes for a nasty confusing mess...

One way to combat the mess is to use aliases in your shell to get the command set you want.

I surrendered and now only use CUPS and the System V command set (which is unambiguous.]
 
One way to combat the mess is to use aliases in your shell to get the command set you want.
Looking at the print/cups/Makefile, there's hidden option which will "disable" the utilities in base (and re-"enable" them on uninstall):
Code:
.if defined(CUPS_OVERWRITE_BASE)
PLIST_SUB+=     OVERWRITE=""
.else
PLIST_SUB+=     OVERWRITE="@comment "
.endif
pkg-plist:
Code:
%%OVERWRITE%%@postexec if test -e /usr/bin/lp; then chmod -h 0 /usr/bin/lp; fi
%%OVERWRITE%%@postexec if test -e /usr/bin/lpq; then chmod -h 0 /usr/bin/lpq; fi
%%OVERWRITE%%@postexec if test -e /usr/bin/lpr; then chmod -h 0 /usr/bin/lpr; fi
%%OVERWRITE%%@postexec if test -e /usr/bin/lprm; then chmod -h 0 /usr/bin/lprm; fi
%%OVERWRITE%%@postexec if test -e /usr/sbin/lpc; then chmod -h 0 /usr/sbin/lpc; fi
%%OVERWRITE%%@postunexec if test -e /usr/bin/lp; then chmod -h 0555 /usr/bin/lp; fi
%%OVERWRITE%%@postunexec if test -e /usr/bin/lpq; then chmod -h 06555 /usr/bin/lpq; fi
%%OVERWRITE%%@postunexec if test -e /usr/bin/lpr; then chmod -h 06555 /usr/bin/lpr; fi
%%OVERWRITE%%@postunexec if test -e /usr/bin/lprm; then chmod -h 06555 /usr/bin/lprm; fi
%%OVERWRITE%%@postunexec if test -e /usr/sbin/lpc; then chmod -h 02555 /usr/sbin/lpc; fi
 
Thanks all. I'm marking this 'solved' at least for now. I'm going to think of A Better Way. Watch this space...
 
Back
Top