README for lp_server
Fri May 30 09:40:17 PDT 1997
This program allows you to 'export' a printer on your local host to be used by an LPRng spooler. It is basically simulating an HP JetDirect interface, which opens a connection on port 9100 and simply dumps input to the PostScript Engine.
lp_server [-n port] [-t stty_options] [-d device]
-n port- listen (bind) to this port for incoming connections-d device- the device to open-t stty_options- a list of stty options, similar (i.e.- identical) to those used by other filters supplied with LPRng.
Build Notes
(added 25 Jan 2024)
CFLAGS="-std=c90" ./configure && make && make install
a systemd unit file for use, tested on Raspberry Pi OS (change device node to suit, and create a unit file for each printer):
[Unit]
Description=JetDirect-compatible server
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/lib/filters/lp_server -n 9100 -d /dev/lp/printers/usb-Hewlett-Packard_hp_LaserJet_1320_series_00CNHC57V00Y
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target
a udev rules file for persistent device nodes for USB printers...drop into /etc/udev/rules.d/99-printers.rules:
ACTION=="remove", GOTO="persistent_printer_end"
SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"
ENV{ID_TYPE}!="printer", GOTO="persistent_printer_end"
ENV{ID_SERIAL}=="?*", SYMLINK+="lp/printers/$env{ID_BUS}-$env{ID_SERIAL}"
LABEL="persistent_printer_end"
extra steps for building on Alpine Linux:
doas apk add gcc musl-dev autoconf make patch && patch -p0 <lp_server-no-glibc.patch
Description
Languages
C
88.2%
Makefile
6.3%
Shell
5.5%