Gentoo Archives: gentoo-user

From: Ramon Fischer <Ramon_Fischer@×××××××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Getting printer working, the road of Pain.
Date: Thu, 08 Sep 2022 22:10:47
Message-Id: AM6PR10MB244075C6FAEC3D8CBB097323EF409@AM6PR10MB2440.EURPRD10.PROD.OUTLOOK.COM
In Reply to: [gentoo-user] Getting printer working, the road of Pain. by Alan Grimes
1 Hello Alan,
2
3 >> (meanwhile, Windows can print to the thing effortlessly....)
4 I guess, that you are going to configure a network printer.
5
6 I will try to explain you my setup; maybe you or others can derive
7 something from this.
8
9 Make sure, that the user, which you configure the printer with, is a
10 member of the group "lpadmin":
11
12 $ gpasswd --add <some_user> lpadmin
13 $ getent group lpadmin
14 lpadmin:x:<some_group_id>:<some_user>
15
16 On the server-site, the configuration file "/etc/cups/cupsd.conf" should
17 be configured like so. See comments for explanations:
18
19 # Only listen for connections from the local machine.
20 Listen localhost:631
21 # custom - 20210706 - rfischer: set custom listen address to
22 "192.168.1.80" to make it available via the network
23 Listen 192.168.1.80:631
24 Listen /run/cups/cups.sock
25
26 # custom - 20210706 - rfischer: make cups available via "hostname"
27 or "domain"
28 ServerAlias *
29
30 # Restrict access to the server...
31 #<Location />
32 #  Order allow,deny
33 #</Location>
34 # custom - 20210706 - rfischer: allow access from "localhost" and
35 via the network
36 <Location />
37   Order allow,deny
38   Allow localhost
39   Allow from 192.168.1.*
40 </Location>
41
42 # Restrict access to the admin pages...
43 #<Location /admin>
44 #  Order allow,deny
45 #</Location>
46 # custom - 20210706 - rfischer: make administration page available
47 via the network
48 <Location /admin>
49   Encryption Required
50   Order allow,deny
51   Allow localhost
52   Allow from 192.168.1.*
53 </Location>
54
55 Restart the daemon on the server-site:
56
57 $ systemctl restart cups
58
59 This will also restart the Systemd socket unit "cups.socket" and
60 "cups.path".
61
62 Make sure, that CUPS is running on "192.168.1.80:631":
63
64 $ ss -tulpan | grep "631"
65 tcp    LISTEN   0        5          192.168.1.80:631 0.0.0.0:*      
66 users:(("cupsd",pid=2190,fd=8))
67 tcp    LISTEN   0        5              127.0.0.1:631
68 0.0.0.0:*       users:(("cupsd",pid=2190,fd=7))
69 tcp    LISTEN   0        5 [::1]:631               [::]:*
70 users:(("cupsd",pid=2190,fd=6))
71
72
73 If printing via hostname is desired, you can add the following entry for
74 your local DNS server:
75
76 192.168.1.80 cups.intern
77
78 This Forward DNS lookup entry can also be entered on the client-site in
79 the configuration file "/etc/hosts".
80
81 Your CUPS isntance should be now available via "cups.intern:631". There
82 you should be able to configure your printer.
83
84 I configured the server-site via USB:
85
86 usb:/<some_printer_name>?serial=<some_serial_number>
87
88 In the best case, CUPS already has a pre-installed printer driver or you
89 have a PPD (PostScript Printer Description) file, which you can upload,
90 when adding the printer.
91
92 Once configured, the directory tree of "/etc/cups/" on the server-site
93 should look like this:
94
95 $ tree -ugp --noreport --charset iwantprintableasciiplease /etc/cups
96 /etc/cups
97 |-- [-rw------- root     lp      ]  classes.conf
98 |-- [-rw-r--r-- root     root    ]  cups-browsed.conf
99 |-- [-rw-r--r-- root     root    ]  cupsd.conf
100 |-- [-rw-r--r-- root     root    ]  cups-files.conf
101 |-- [drwxr-xr-x root     root    ]  interfaces
102 |-- [drwxr-xr-x root     lp      ]  ppd
103 |   |-- [-rw-r----- root     lp      ] <some_printer_name>.ppd
104 |-- [-rw------- root     lp      ]  printers.conf
105 |-- [-rw-r--r-- root     root    ]  raw.convs
106 |-- [-rw-r--r-- root     root    ]  raw.types
107 |-- [-rw-r--r-- root     root    ]  snmp.conf
108 |-- [drwx------ root     lp      ]  ssl
109 |   |-- [-rw-r--r-- root     root    ]
110 <some_hostname_from_/etc/hostname>.crt
111 |   |-- [-rw-r--r-- root     root    ]
112 <some_hostname_from_/etc/hostname>.key
113 `-- [-rw-r----- root     lp      ]  subscriptions.conf
114
115 Since I do not want to install the printer driver on every client and
116 let the clients render the pages, I want to let the server handle these
117 things.
118
119 On the client-site (localhost:631) therefore, I can just add the printer
120 via "http/s" or "ipp/s" and transfer everything either via "IPP
121 everywhere" or "raw":
122
123 ipps://cups.intern:631/printers/<some_printer_name>
124
125 Be aware, that "raw" is deprecated and newer versions of CUPS will
126 remove it. So "IPP everywhere" would be the choice, but I stick to
127 "raw", since the former shuffles print jobs for some reason, when I want
128 to print multiple files via "lpr <some_file1> <some_file2>" on either
129 the client- or server-site.
130
131 You should now be able to print a test page on the client- and server-site.
132
133 Much success and a pinch of luck! :)
134
135 -Ramon
136
137 On 08/09/2022 18:52, Alan Grimes wrote:
138 > Ok. I'm going to have to do it. I'm going to have to get my blessed
139 > printer working.
140 >
141 > It is the finest laser printer money can buy. God himself uses it to
142 > process the paperwork involved in assigning souls to either heaven or
143 > hell... What I'm saying is that the printer is such an immaculate
144 > example of printing perfection that linux is going to give me absolute
145 > hell getting it working.
146 >
147 > I will be sthocked if I can get it working in less than two weeks
148 > working full time and without influcting a migraine and/or an ulcer on
149 > myself.
150 >
151 > (meanwhile, Windows can print to the thing effortlessly....)
152 >
153 > Right now linux is so broken that the CUPS web interface will deny all
154 > attempts to administer the printer and reject any password. The config
155 > file is written in moonspeak, I just need the motherfucking thing to
156 > say yes when I tell it to do a thing. I expect it to take 2-3 days
157 > just to get over this hurdle.
158 >
159 > How can people actually go around installing linux on people's
160 > computers as if they were doing them a favor when it really is this bad?
161 >
162
163 --
164 GPG public key: 5983 98DA 5F4D A464 38FD CF87 155B E264 13E6 99BF

Attachments

File name MIME type
OpenPGP_signature.asc application/pgp-signature