# CUPS Problems

## Schuthrax

Let me first start by saying that I accidentally posted a message to the Hardware & Laptops forum https://forums.gentoo.org/viewtopic.php?t=27959 and boy do I feel stupid. But anyway, after reading some more posts, I went looking in my var/log/cups/error_log and found this:

I [29/Dec/2002:22:30:53 -0800] Sending browsing info to 3fcf5a65:631

I [29/Dec/2002:22:30:53 -0800] Configured for up to 100 clients.

I [29/Dec/2002:22:30:53 -0800] Allowing up to 10 client connections per host.

I [29/Dec/2002:22:30:54 -0800] LoadPPDs: Read "/etc/cups/ppds.dat", 1332 PPDs...

I [29/Dec/2002:22:30:54 -0800] LoadPPDs: Wrote "/etc/cups/ppds.dat", 1332 PPDs...

E [29/Dec/2002:22:30:55 -0800] StartListening: Unable to bind socket - Cannot assign requested address.

This has me completely bewildered! Why would CUPS be having a socket problem? Are there permissions that weren't set somehow? Is there a CUPS user or group that should have been created? (I checked, and there is none.)

Please, I'd really like to get this working and will try just about anything at this point!

----------

## pilla

Don't you have something running on that socket? Try to stop and start again cupsd

----------

## pjp

Moved from Installing Gentoo.

 *Forums front page wrote:*   

> Installing Gentoo
> 
> If you've finished the install guide, look somewhere else. But if you're still working your way through it, or just need some info before you start your install, this is the place.

 

----------

## Schuthrax

How can I tell if something is using the 631 socket already? Regardless, after the system is freshly booted, I log in as root real quick and run "/etc/init.d/cupsd start". Oddly, if I then immediately run "/etc/init.d/cupsd stop" it fails!

I still remain mystified.

----------

## kraaij

Did you solve this problem? I had cups running, but after I upgraded my kernel to switch over to wireless lan (working!!!  :Smile:  ), I am having this same problem. 

Can you help?

Thanks,

Anton.

----------

## zyzzyr

Hello,

I have the exact same problem.  It's even more tiresome considering it worked fine, then one day seemingly stopped working (though I had emerged several packages since then - I can't figure out what the change was that stopped this from working).

netstat -a shows

tcp        0      0 localhost:631           *:*                     LISTEN

Similarly, I cannot stop cups (I must zap it), and restarting does the same thing.

I don't understand why it stopped working suddenly.

Any help would be appreciated!

----------

## kraaij

For me, the problem was solved by looking in my /etc/cups/cupsd.conf file. I had switched over to wireless and thus had a different ip adress, while my cups server wanted to listen to a port on the old ip adres. A change of the ip adress and it was solved!

Look for a line like:

```

Listen 192.168.xold.yold:631

```

And change it accordingly. Maybe this helps?

Greetings,

Anton.

----------

## zyzzyr

Hi,

My line reads:

Listen 127.0.0.1:631

So there's not really anything I can change it to  :Smile: 

----------

## zyzzyr

Hello,

I have found a workaround solution.

The problem seems to be a conflict between fam and cups

fam starts up prior to cups, and fam seems to chew up port 631

the output of netstat -a upon boot includes a bunch of lines such as ...

```

tcp        0      0 localhost:631           localhost:33941         TIME_WAIT

tcp        0      0 localhost:631           localhost:34197         TIME_WAIT

tcp        0      0 localhost:631           localhost:35477         TIME_WAIT

```

so I do the following

```

/etc/init.d/cupsd stop

/etc/init.d/cupsd zap

/etc/init.d/fam stop

/etc/init.d/cupsd start

/etc/init.d/cupsd stop

/etc/init.d/cupsd zap

/etc/init.d/cupsd start

/etc/init.d/fam start

```

and everything is hunky dory.

The stop/zap is just to ensure that it is set to off in case stop failed.  As to why I need to start cupsd twice after killing fam ... I have no idea.  Maybe starting up cupsd kills off those extra lines from above in netstat -a?

Any help would be appreciated in this area.  I dislike having to do this on a reboot!

Thanks

zyzzyr

----------

## MIT_Service

I got the same problem, too. Someday it just stopped working.

Problem is: netstat -a shows nothing on port 631. But cupsd can't bind the socket cause it's already "in use".

On the other hand: I don't have fam running. Guess i got a problem here...

Anyone got a suggestion?

----------

## redrover

Adding the -p option to netstat shows the process holding the port.

I was having this problem with cupsd complaining that the port was already in use and

found in my case that rpc.statd was using the port. 

Starting up cupsd after first killing rpc.statd was successful.  Then restarting rpc.statd 

caused it to be assigned a different port.

----------

## milothurston

In my case, cupsd seems to be using the socket, but I get the same error.

```

rzirzaraz cups # netstat -pl | grep 631

tcp        0      0 *:631                   *:*                     LISTEN      918/cupsd           

udp        0      0 *:631                   *:*                                 918/cupsd           

```

Milo.

----------

## Jesper

I had the same problem that Cups wouldn't start after an update. The solution for me was to move cups from starting in boot to start in default by using rc-update

hope this will help some

----------

## doodle

I just experienced the same problem - after a seemingly innocent update of /etc/cups/cupsd.conf, cupsd started to fail during boot with this message in /var/log/cups/error_log:

```
StartListening: Unable to bind socket - Cannot assign requested address.
```

A little research showed these dependencies in /etc/init.d/cupsd:

```
depend() {

        use net

        after logger

        before nfs

        use vmware

}

```

Aha!! There's the culprit - if your setup is anything like mine your net is probably started using any number of:

```
net.lo

net.eth0

net.eth1

net.blabla

```

So the dependency in cupsd "net" is really worthless - it should specifically list all interfaces that your cupsd is set up to listen to. Otherwise cupsd will try to bind a socket to an address before the corresponding interface is up and runnng. In my case that looks like this in /etc/cupsd/cupsd.conf:

```
Listen localhost:631

Listen talisker:631

```

My machine is called talisker (yes, I like good single malt scotch whisky   :Very Happy:  ), defined in /etc/hosts as:

```
192.168.1.130   talisker.kratko.dk talisker

```

And the address 192.168.1.130 is assigned to the interface eth0. So simply by updating the cupsd dependencies to this:

```
depend() {

        use net.lo

        use net.eth0

        after logger

        before nfs

        use vmware

}
```

- the problem goes away. My cupsd now comes up correctly.

----------

## deepthought

Please file a bug on this at https://bugs.gentoo.org, as this is certainly not the desired behaviour during system boot.

Regards,

Alexander

----------

## doodle

This seems to be a known bug ... see Bugzilla Bug 29231.

Apparently saying

```
need net
```

instead of

```
use net
```

in the dependency of /etc/init.d/cupsd is another workaround (for the same problem, i.e. that cupsd starts before interfaces are up).

----------

## SerfurJ

i solved this problem by killing cupsd.  i guess the new cups init script doesn't see the cupsd from the old installation.. or something.

----------

## STEDevil

 *kraaij wrote:*   

> a different ip adress, while my cups server wanted to listen to a port on the old ip adres. A change of the ip adress and it was solved!
> 
> 

 

I had the same problem because of an old incorrect entry in /etc/hosts for localhost. Just had to comment it out and cupsd started right up  :Smile: 

No more 

 * Starting cupsd...

cupsd: Child exited with status 99!

BTW, me managing to find the solution to my problem was helped by updating to (unstable) 1.2.3 version of cupsd simply becuase its errormessages in /var/log/cupsd/error_log states the IPaddress in decimal instead of the almost non humanly redable hexadecimal format of the 1.1.x cupsd versions.

----------

