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. 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;About the hosts file: it is /etc/hosts. Often just things asman 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.
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,tcp4 127.0.0.1.631 LISTEN
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"?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?
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.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 andtruss -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.
This is my etc/hosts file, that I have not touched. Do there need to be any changes here?There is only one /etc/hosts file. The others are for TCP wrappers, see hosts_access(3). Just don't touch those.
# $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.)
#
No, it looks fine.Do there need to be any changes here?
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.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.
what is the command for the cupsd pid?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.
There are 3 numbers from that command. In order from left to right they are 1429, 4812, & 2260.ps aux|grep cups
> 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
If you post the output we can actually have a look at it too.There are 3 numbers from that command. In order from left to right they are 1429, 4812, & 2260.
Which is the PID?
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!I can show you what I get here.
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.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
>ps aux|grep cups
root 1235 0.0.0.1 4812 2228 0 S+ 02:49 0:00.00 grep cups
How can I check I have the proper security level?Then you're either in single user mode or you enabled a security level.
The PID is in the second column. OK, now I understand your statement about the three numbers!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?
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. 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 ps aux | grep [c]ups
. Example to show the difference: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 -
If that is your output then cupsd is not running. You need to start it after adding more logging to it. See cupsctl(8)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.
cupsctl --debug-logging
I apologise if I assumed you knew this.-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.