public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Ramon Fischer <Ramon_Fischer@hotmail.de>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Getting printer working, the road of Pain.
Date: Fri, 9 Sep 2022 00:10:30 +0200	[thread overview]
Message-ID: <AM6PR10MB244075C6FAEC3D8CBB097323EF409@AM6PR10MB2440.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <9b267743-3c9e-86dd-31f7-631b116dc251@verizon.net>


[-- Attachment #1.1: Type: text/plain, Size: 6213 bytes --]

Hello Alan,

>> (meanwhile, Windows can print to the thing effortlessly....)
I guess, that you are going to configure a network printer.

I will try to explain you my setup; maybe you or others can derive 
something from this.

Make sure, that the user, which you configure the printer with, is a 
member of the group "lpadmin":

    $ gpasswd --add <some_user> lpadmin
    $ getent group lpadmin
    lpadmin:x:<some_group_id>:<some_user>

On the server-site, the configuration file "/etc/cups/cupsd.conf" should 
be configured like so. See comments for explanations:

    # Only listen for connections from the local machine.
    Listen localhost:631
    # custom - 20210706 - rfischer: set custom listen address to
    "192.168.1.80" to make it available via the network
    Listen 192.168.1.80:631
    Listen /run/cups/cups.sock

    # custom - 20210706 - rfischer: make cups available via "hostname"
    or "domain"
    ServerAlias *

    # Restrict access to the server...
    #<Location />
    #  Order allow,deny
    #</Location>
    # custom - 20210706 - rfischer: allow access from "localhost" and
    via the network
    <Location />
       Order allow,deny
       Allow localhost
       Allow from 192.168.1.*
    </Location>

    # Restrict access to the admin pages...
    #<Location /admin>
    #  Order allow,deny
    #</Location>
    # custom - 20210706 - rfischer: make administration page available
    via the network
    <Location /admin>
       Encryption Required
       Order allow,deny
       Allow localhost
       Allow from 192.168.1.*
    </Location>

Restart the daemon on the server-site:

    $ systemctl restart cups

This will also restart the Systemd socket unit "cups.socket" and 
"cups.path".

Make sure, that CUPS is running on "192.168.1.80:631":

    $ ss -tulpan | grep "631"
    tcp    LISTEN   0        5          192.168.1.80:631 0.0.0.0:*      
    users:(("cupsd",pid=2190,fd=8))
    tcp    LISTEN   0        5              127.0.0.1:631
    0.0.0.0:*       users:(("cupsd",pid=2190,fd=7))
    tcp    LISTEN   0        5 [::1]:631               [::]:*
    users:(("cupsd",pid=2190,fd=6))


If printing via hostname is desired, you can add the following entry for 
your local DNS server:

    192.168.1.80 cups.intern

This Forward DNS lookup entry can also be entered on the client-site in 
the configuration file "/etc/hosts".

Your CUPS isntance should be now available via "cups.intern:631". There 
you should be able to configure your printer.

I configured the server-site via USB:

    usb:/<some_printer_name>?serial=<some_serial_number>

In the best case, CUPS already has a pre-installed printer driver or you 
have a PPD (PostScript Printer Description) file, which you can upload, 
when adding the printer.

Once configured, the directory tree of "/etc/cups/" on the server-site 
should look like this:

    $ tree -ugp --noreport --charset iwantprintableasciiplease /etc/cups
    /etc/cups
    |-- [-rw------- root     lp      ]  classes.conf
    |-- [-rw-r--r-- root     root    ]  cups-browsed.conf
    |-- [-rw-r--r-- root     root    ]  cupsd.conf
    |-- [-rw-r--r-- root     root    ]  cups-files.conf
    |-- [drwxr-xr-x root     root    ]  interfaces
    |-- [drwxr-xr-x root     lp      ]  ppd
    |   |-- [-rw-r----- root     lp      ] <some_printer_name>.ppd
    |-- [-rw------- root     lp      ]  printers.conf
    |-- [-rw-r--r-- root     root    ]  raw.convs
    |-- [-rw-r--r-- root     root    ]  raw.types
    |-- [-rw-r--r-- root     root    ]  snmp.conf
    |-- [drwx------ root     lp      ]  ssl
    |   |-- [-rw-r--r-- root     root    ]
    <some_hostname_from_/etc/hostname>.crt
    |   |-- [-rw-r--r-- root     root    ]
    <some_hostname_from_/etc/hostname>.key
    `-- [-rw-r----- root     lp      ]  subscriptions.conf

Since I do not want to install the printer driver on every client and 
let the clients render the pages, I want to let the server handle these 
things.

On the client-site (localhost:631) therefore, I can just add the printer 
via "http/s" or "ipp/s" and transfer everything either via "IPP 
everywhere" or "raw":

    ipps://cups.intern:631/printers/<some_printer_name>

Be aware, that "raw" is deprecated and newer versions of CUPS will 
remove it. So "IPP everywhere" would be the choice, but I stick to 
"raw", since the former shuffles print jobs for some reason, when I want 
to print multiple files via "lpr <some_file1> <some_file2>" on either 
the client- or server-site.

You should now be able to print a test page on the client- and server-site.

Much success and a pinch of luck! :)

-Ramon

On 08/09/2022 18:52, Alan Grimes wrote:
> Ok. I'm going to have to do it. I'm going to have to get my blessed 
> printer working.
>
> It is the finest laser printer money can buy. God himself uses it to 
> process the paperwork involved in assigning souls to either heaven or 
> hell... What I'm saying is that the printer is such an immaculate 
> example of printing perfection that linux is going to give me absolute 
> hell getting it working.
>
> I will be sthocked if I can get it working in less than two weeks 
> working full time and without influcting a migraine and/or an ulcer on 
> myself.
>
> (meanwhile, Windows can print to the thing effortlessly....)
>
> Right now linux is so broken that the CUPS web interface will deny all 
> attempts to administer the printer and reject any password. The config 
> file is written in moonspeak, I just need the motherfucking thing to 
> say yes when I tell it to do a thing. I expect it to take 2-3 days 
> just to get over this hurdle.
>
> How can people actually go around installing linux on people's 
> computers as if they were doing them a favor when it really is this bad?
>

-- 
GPG public key: 5983 98DA 5F4D A464 38FD CF87 155B E264 13E6 99BF


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  parent reply	other threads:[~2022-09-08 22:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <9b267743-3c9e-86dd-31f7-631b116dc251.ref@verizon.net>
2022-09-08 16:52 ` [gentoo-user] Getting printer working, the road of Pain Alan Grimes
2022-09-08 18:04   ` tastytea
2022-09-08 19:24     ` Michael
2022-09-08 20:24     ` Lee
2022-09-08 20:40       ` Wols Lists
2022-09-08 22:56         ` Peter Humphrey
2022-09-09 11:50           ` David M. Fellows
2022-09-08 22:10   ` Ramon Fischer [this message]
2022-09-10  0:18   ` Paul Colquhoun
2022-09-10  8:09     ` Wols Lists
2022-09-10  9:59       ` karl
2022-09-10 15:32       ` [gentoo-user] " Grant Edwards

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM6PR10MB244075C6FAEC3D8CBB097323EF409@AM6PR10MB2440.EURPRD10.PROD.OUTLOOK.COM \
    --to=ramon_fischer@hotmail.de \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox