localhost:631 printer problem (SOLVED)

About the hosts file: it is /etc/hosts. Often just things as man hosts resulting in hosts(5) give an answer. I have never tried that before. It is always a surprise how much stuff is documented.

About the cups server: It is often better to check if a service is running without having to handle additional pitfalls as browsers. netstat -a -n -p tcp should inform about a 127.0.0.1 listening at 631. There are so many tools on board. I think nobody knows all of them.
 
About the hosts file: it is /etc/hosts. Often just things as man hosts resulting in hosts(5) give an answer. I have never tried that before. It is always a surprise how much stuff is documented.

About the cups server: It is often better to check if a service is running without having to handle additional pitfalls as browsers. netstat -a -n -p tcp should inform about a 127.0.0.1 listening at 631. There are so many tools on board. I think nobody knows all of them.
That command gives;
tcp4 127.0.0.1.25 LISTEN
tcp4 127.0.0.1.631 LISTEN
tcp6 0::1.631 LISTEN
All 3 are shown as having foreign address *.*
cupsd is shown as 'starting' at bootup

Is there a similar command diagnostic to indicate why 631 will not open?
 
tcp4 127.0.0.1.631 LISTEN
This should be the cups daemon wating for requests. But you are right, it does not inform if it will respond to any request. One can open a port but do nothing. But this is very unlikely for the cups daemon on your system because the same cups daemon works on many oher installations,
 
I am trying to setup my new mono HP LaserJet Pro M404dn, having already downloaded pkg hplip 3.20.6
I am trying to open http://localhost:631/printers to enable cups but the address does not work.
Is it permanently down?
I have to ask the obvious. Is the machine you are running CUPS on the same as the one you're trying to use the address "localhost"?
Also, try using https not http.
What's your cups config file look like? Post it here, if you can.
You mentioned a firewall? We can rule out the firewall by finding the pid of cupsd and truss -p {cupsd_pid_number} and then try to connect via your browser. If a bunch of stuff scrolls on the screen, you're connecting. If not, it's the firewall.
 
I notice there are 6 host files in the etc directory. How many of them have a direct bearing on this issue?
 
I have to ask the obvious. Is the machine you are running CUPS on the same as the one you're trying to use the address "localhost"?
Also, try using https not http.
What's your cups config file look like? Post it here, if you can.
You mentioned a firewall? We can rule out the firewall by finding the pid of cupsd and truss -p {cupsd_pid_number} and then try to connect via your browser. If a bunch of stuff scrolls on the screen, you're connecting. If not, it's the firewall.
the same.
https: no effect
Is that cups-files.conf OR cupssd.conf in /usr/local/etc.cups that you would like posted. They are both quite large.
I am also concerned that localhost:631 does not work on my Win 10 computers (is there a prerequisite that the OS has to have cups running for it to work).
Maybe, if you want, it would be better to just specify what need to be mandatory inclusions, in any of them, for it to work.
 
There is only one /etc/hosts file. The others are for TCP wrappers, see hosts_access(3). Just don't touch those.
This is my etc/hosts file, that I have not touched. Do there need to be any changes here?
Code:
# $FreeBSD: releng/12.2/lib/libc/net/hosts 338729 2018-09-17 18:56:47Z brd $
#
# Host Database
#
# This file should contain the addresses and aliases for local hosts that
# share this file.  Replace 'my.domain' below with the domainname of your
# machine.
#
# In the presence of the domain name service or NIS, this file may
# not be consulted at all; see /etc/nsswitch.conf for the resolution order.
#
#
::1            localhost localhost.my.domain
127.0.0.1        localhost localhost.my.domain
#
# Imaginary network.
#10.0.0.2        myname.my.domain myname
#10.0.0.3        myfriend.my.domain myfriend
#
# According to RFC 1918, you can use the following IP networks for
# private nets which will never be connected to the Internet:
#
#    10.0.0.0    -   10.255.255.255
#    172.16.0.0    -   172.31.255.255
#    192.168.0.0    -   192.168.255.255
#
# In case you want to be able to connect to the Internet, you need
# real official assigned numbers.  Do not try to invent your own network
# numbers but instead get one from your network provider (if any) or
# from your regional registry (ARIN, APNIC, LACNIC, RIPE NCC, or AfriNIC.)
#
 
the same.
https: no effect
Is that cups-files.conf OR cupssd.conf in /usr/local/etc.cups that you would like posted. They are both quite large.
I am also concerned that localhost:631 does not work on my Win 10 computers (is there a prerequisite that the OS has to have cups running for it to work).
Maybe, if you want, it would be better to just specify what need to be mandatory inclusions, in any of them, for it to work.
If you used "localhost" on Win 10 then of course it wouldn't. You need to specify the IP number of the host running cups.
Don't worry about the cups file, it is probably ok if you haven't edited it. I would be more interested in you performing a truss of the process as I explained earlier.
 
If you used "localhost" on Win 10 then of course it wouldn't. You need to specify the IP number of the host running cups.
Don't worry about the cups file, it is probably ok if you haven't edited it. I would be more interested in you performing a truss of the process as I explained earlier.
what is the command for the cupsd pid?
 
I can show you what I get here.
Code:
> ps aux|grep cups
root        1188   0,0  0,2   29232   7784  -  Is   16:53     0:00,01 /usr/local/sbin/cupsd -C /usr/local/etc/cups/cupsd.conf -s /usr/local/etc/cups/cups-files.conf
chris      32306   0,0  0,1   11304   2724  0  R+   17:20     0:00,00 grep --color=auto cups
The first one is related to the daemon, by the way: nothing has been printed. The second entry comes from the grep. I am not sure why you have three entries. The output on the screen should inform about that.
 
There are 3 numbers from that command. In order from left to right they are 1429, 4812, & 2260.
Which is the PID?
If you post the output we can actually have a look at it too.

Remember, we can't see what you're doing or what you're looking at. We don't have access to your system and we're not clairvoyant. So all we can do at this point is guess.
 
I can show you what I get here.
Code:
> ps aux|grep cups
root        1188   0,0  0,2   29232   7784  -  Is   16:53     0:00,01 /usr/local/sbin/cupsd -C /usr/local/etc/cups/cupsd.conf -s /usr/local/etc/cups/cups-files.conf
chris      32306   0,0  0,1   11304   2724  0  R+   17:20     0:00,00 grep --color=auto cups
The first one is related to the daemon, by the way: nothing has been printed. The second entry comes from the grep. I am not sure why you have three entries. The output on the screen should inform about that.
I had to copy this by hand because I couldn't get an up to date answer online that worked, ie.,in order for copying & pasting from the terminal, so anyhow here it is!
Code:
>ps aux|grep cups
root     1235  0.0.0.1   4812   2228  0  S+ 02:49  0:00.00   grep cups
---------------------------------------------------------------------------------------------------
Doesn't your 7784 correspond to my 2228 in terms of what I referred to as a 3rd number?
I don't know where you got your 'files.conf' file, so I can't comment there.
Does mine look respectable or is it missing something important?
Is 1235 the PID? (its all very cryptic & I'm not up to pace on it)
Thanks.
 
I had to copy this by hand because I couldn't get an up to date answer online that worked, ie.,in order for copying & pasting from the terminal, so anyhow here it is!
Code:
>ps aux|grep cups
root 1235 0.0.0.1 4812 2228 0 S+ 02:49 0:00.00 grep cups
---------------------------------------------------------------------------------------------------
Doesn't your 7784 correspond to my 2228 in terms of what I referred to as a 3rd number?
The PID is in the second column. OK, now I understand your statement about the three numbers!
On your system cups is not running, it is just the grep with PID 1235. When you start the grep a second time the number will most likely be increased.

About ps aux you can display for example just two lines by ps aux|head -n 2. Then you will see the description of the columns.

Please run as root service cupsd onestart and see if there will be an output as on my system. If not there might be some error message, either on the screen or somewhere in the files of /var/log/. It is cryptic from the first perspective. But you will get more and more used to the command line stuff. Finally you will have better control and you will be faster than by digging with mouse clicks through a GUI :beer::D
 
Here is a tip to avoid false positives when using grep: ps aux | grep [c]ups. Example to show the difference:
Code:
tingo@kg-core2$ ps aux | grep cups
root         679    0.0  0.0    82684    4708  -  Is   15Feb21      0:00.23 /usr/local/sbin/cupsd -
tingo      65992    0.0  0.0     6652    2296 39  S+   22:34        0:00.00 grep cups
tingo@kg-core2$ ps aux | grep [c]ups
root         679    0.0  0.0    82684    4708  -  Is   15Feb21      0:00.23 /usr/local/sbin/cupsd -
this is just one of the useful things you can do with regexps...
 
I had to copy this by hand because I couldn't get an up to date answer online that worked, ie.,in order for copying & pasting from the terminal, so anyhow here it is!
Code:
>ps aux|grep cups
root     1235  0.0.0.1   4812   2228  0  S+ 02:49  0:00.00   grep cups
---------------------------------------------------------------------------------------------------
Doesn't your 7784 correspond to my 2228 in terms of what I referred to as a 3rd number?
I don't know where you got your 'files.conf' file, so I can't comment there.
Does mine look respectable or is it missing something important?
Is 1235 the PID? (its all very cryptic & I'm not up to pace on it)
Thanks.
If that is your output then cupsd is not running. You need to start it after adding more logging to it. See cupsctl(8) cupsctl --debug-logging

Also, if you read the ps(1) manual page, it states under -u option:
-u Display information associated with the following keywords: user,
pid, %cpu, %mem, vsz, rss, tt, state, start, time, and command.
The -u option implies the -r option.
I apologise if I assumed you knew this.
So, yes, the 2nd field is the PID.
 
tingo, I'm not familiar with that use of one character in a bracket, and I can't find a web page search term that is working for me. (Nor skimming through some regex sites). Would you mind explaining why that [c]ups doesn't show the grep PID?
Thanks.

And as soon as I posted that I found the answer, that it prevents grep from matching itself. Going to add a thanks though, as I hadn't known about that one, and it is useful, in my opinion.
 
Back
Top