CUPS problems.

Hi,

Running Lxde, and I have a printer on the local network.


systemctl status cups.service
cups.service - CUPS Printing Service
   Loaded: loaded (/usr/lib/systemd/system/cups.service; disabled)
   Active: active (running) since Sat 2016-04-23 21:56:06 BST; 30min ago
 Main PID: 1808 (cupsd)
   CGroup: /system.slice/cups.service
           ├─1808 /usr/sbin/cupsd -f
           ├─3661 /usr/lib/cups/cgi-bin/jobs.cgi
           └─3665 /usr/lib/cups/cgi-bin/admin.cgi

netstat -ltunp|grep LISTEN
  
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      1808/cupsd          
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      2015/smbd           


If I go to the corner taskbar icon, system, admin, manage printer I get the basic cups page and unable to change tabs, if I go direct from firefox, nothing,

Any ideas?

You mean the following URL does not result in a CUPS page being served?

http://localhost:631

Exactly, if I try that it just waits forever. Whereas following the administer printer link does at least bring up the CUPS 1.7.5 page to see something, but then does not let me see any other pages. But once I have followed the administer CUPS link, the main page does then come up for that session, until I reboot.

Check that /etc/cups/cupsd.conf contains

Listen localhost:631

If that check out okay, try the following from a terminal

wget -p http://localhost:631 -O /dev/null

from the cupsd conf file:


# Log general information in error_log - change "warn" to "debug"
# for troubleshooting...
LogLevel warn

# Only listen for connections from the local machine.
Listen localhost:631
Listen /run/cups/cups.sock

# Show shared printers on the local network.
Browsing On
BrowseLocalProtocols dnssd

# Default authentication type, when authentication is required...
DefaultAuthType Basic

# Web interface setting...
WebInterface Yes

# Restrict access to the server...
<Location />
  Order allow,deny
</Location>

# Restrict access to the admin pages...
<Location /admin>
  Order allow,deny
  Allow localhost
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
</Location>


and wget gave this:


ing -O with -r or -p will mean that all downloaded content
will be placed in the single file you specified.

--2016-04-24 11:02:25--  http://localhost:631/
Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:631... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3697 (3.6K) [text/html]
Saving to: ‘/dev/null’

100%=================================================================================================================================>] 3,697       --.-K/s   in 0s      

2016-04-24 11:02:25 (490 MB/s) - ‘/dev/null’ saved [3697/3697]

FINISHED --2016-04-24 11:02:25--
Total wall clock time: 0.01s
Downloaded: 1 files, 3.6K in 0s (490 MB/s)


Okay, that checks out as expected. Firefox is not configured to use a proxy server perhaps?

Hi, well firefox is set to autodetect, but I have not deliberately chosen to have proxy, as it is a personal network behind the router firewall, so no special need to have one.

I tried this and it just hung:

wget -p http://localhost:631/admin -O /dev/null
WARNING: combining -O with -r or -p will mean that all downloaded content
will be placed in the single file you specified.

–2016-04-24 14:57:59-- http://localhost:631/admin
Resolving localhost (localhost)… 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:631… connected.
HTTP request sent, awaiting response…

Still learning and looking, found /var/cups/

so in the error logs I get this:


E [21/Apr/2016:21:01:13 +0100] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.
E [21/Apr/2016:22:51:26 +0100] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.
E [22/Apr/2016:15:35:38 +0100] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.
E [22/Apr/2016:15:47:44 +0100] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.
E [23/Apr/2016:10:13:50 +0100] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.
E [23/Apr/2016:18:55:12 +0100] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.
E [23/Apr/2016:20:31:47 +0100] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.
E [23/Apr/2016:21:56:06 +0100] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.
E [23/Apr/2016:22:24:52 +0100] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.
E [23/Apr/2016:22:24:52 +0100] Unable to bind socket for address 127.0.0.1:631 - Address already in use.
E [23/Apr/2016:22:25:37 +0100] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.
E [23/Apr/2016:22:25:37 +0100] Unable to bind socket for address 127.0.0.1:631 - Address already in use.
E [24/Apr/2016:09:49:05 +0100] Unable to remove /run/cups/certs/0!
E [24/Apr/2016:09:49:05 +0100] Unable to remove /run/cups/certs/0!
E [24/Apr/2016:09:49:55 +0100] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.
E [24/Apr/2016:09:54:46 +0100] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.
E [24/Apr/2016:19:54:19 +0100] Unable to bind socket for address [v1.::1]:631 - Cannot assign requested address.

So how do I track down the duplicate use of the port?

I noticed that in your opening post cups.service is disabled.

systemctl status cups.service
cups.service - CUPS Printing Service
     Loaded: loaded (/usr/lib/systemd/system/cups.service; disabled)

I would have generally expected it to be enabled. Are you having to start it manually? Is this a clean install, or did you upgrade from openSUSE 13.1? I’m just wondering if stale systemd config at play. This thread may be worth reading (post #8 onwards).

Well this is a brand new install, but the mismatch between skylake and the vanilla 4.1 kernel meant a lot of messing about to get it stable, so things may have got corrupted along the way.

I found another thread saying to change the listen to a plain 631, https://bbs.archlinux.org/viewtopic.php?id=176201 but that did not work for me, also after this thread started there have been changes made, so the CUPS plain beginning page does load, so that confirms it is now running I believe, but that it cannot get to the admin or other pages at all is puzzling.

also:


systemctl is-failed cups.service
active

Well, ensure cups.service is enabled

systemctl enable cups.service

then reboot, and check that it is still enabled

systemctl status cups.service

Run this command as well and capture the output

find /etc/systemd/system/ -iname "cups*"

cups startup had already been sorted.

But this one looks a little wrong to me:


find /etc/systemd/system/ -iname "cups*"
/etc/systemd/system/multi-user.target.wants/cups-browsed.service
/etc/systemd/system/multi-user.target.wants/cups.service


I am not on multi-user.target, could that be part of the problem?

And on what target are you?

It’s probably graphical.target, which requires multi-user.target.

In systemd, more than one target can be active at the same time.
Just have a look at the output of “systemctl | grep target”… :wink:

Starting graphical.target implies starting multi-user.target (and all its wanted services) first.

Hi,


systemctl | grep target
sys-devices-pci0000:00-0000:00:14.0-usb2-2\x2d5-2\x2d5:1.0-host8-target8:0:0-8:0:0:0-block-sdf.device loaded active plugged   WorkflowSR2
sys-devices-pci0000:00-0000:00:17.0-ata6-host5-target5:0:0-5:0:0:0-block-sr0.device                   loaded active plugged   HL-DT-ST_DVDRAM_GH24NSC0
basic.target                                                                                          loaded active active    Basic System
cryptsetup.target                                                                                     loaded active active    Encrypted Volumes
getty.target                                                                                          loaded active active    Login Prompts
graphical.target                                                                                      loaded active active    Graphical Interface
local-fs-pre.target                                                                                   loaded active active    Local File Systems (Pre)
local-fs.target                                                                                       loaded active active    Local File Systems
multi-user.target                                                                                     loaded active active    Multi-User System
network-online.target                                                                                 loaded active active    Network is Online
network.target                                                                                        loaded active active    Network
nss-lookup.target                                                                                     loaded active active    Host and Network Name Lookups
nss-user-lookup.target                                                                                loaded active active    User and Group Name Lookups
paths.target                                                                                          loaded active active    Paths
remote-fs-pre.target                                                                                  loaded active active    Remote File Systems (Pre)
remote-fs.target                                                                                      loaded active active    Remote File Systems
rpcbind.target                                                                                        loaded active active    RPC Port Mapper
slices.target                                                                                         loaded active active    Slices
sockets.target                                                                                        loaded active active    Sockets
sound.target                                                                                          loaded active active    Sound Card
swap.target                                                                                           loaded active active    Swap
sysinit.target                                                                                        loaded active active    System Initialization
time-sync.target                                                                                      loaded active active    System Time Synchronized
timers.target                                                                                         loaded active active    Timers

The reason I asked was because my system would not boot to gui in my other thread, and that was because it somehow ended up at multi-user target for its boot up mode. So I need to look elsewhere for the non-opening of the admin page. I think I may need to look at the ipv4/ipv6 issues between systemd and cups, but not sure what to try changing first, as the link in post 11 of this thread is for a different linux flavour and many of the locations are different.

I do remember, and you set the default boot target to graphical.target.
But as mentioned, starting graphical.target does imply starting multi-user.target, it just additionally starts the graphical interface.

And both are active as you can see from your output:

graphical.target                                                                                      loaded active active    Graphical Interface
multi-user.target                                                                                     loaded active active    Multi-User System

But, just because a target is active, doesn’t mean that all services have been started successfully.

To see whether cups.service is active (i.e. the cups daemon is running), run “systemctl status cups.service”, or “systemctl | grep cups.service”.

Hi,


systemctl status cups.service
cups.service - CUPS Printing Service
   Loaded: loaded (/usr/lib/systemd/system/cups.service; enabled)
   Active: active (running) since Tue 2016-04-26 07:41:11 BST; 11h ago
 Main PID: 1699 (cupsd)
   CGroup: /system.slice/cups.service
           ├─1699 /usr/sbin/cupsd -f
           └─6662 /usr/lib/cups/cgi-bin/admin.cgi


So it is running for sure, but that admin page is stalled.