# enabling cups at boot with systemd [solved]

## mani001

Hi,

if I enable the cups service with systemd via

```

systemctl enable cups.service

```

then, cups is not listening when I input http://localhost:631/ in a browser, and in /var/log/cups/error_log, I can see at the end

```

Unable to bind socket for address [v1.::1]:631 - Address already in use.

```

However, if I disable cups at boot and start the service via

```

systemctl start cups

```

once I've logged in, then there is no error message in /var/log/cups/error_log and the cups server is listening in localhost:631

is anyone else experiencing this kind of problem?

Cheers!!Last edited by mani001 on Wed Dec 18, 2013 10:50 pm; edited 1 time in total

----------

## mani001

For what is worth...a dodgy workaround is putting a script starting cups in /etc/NetworkManager/dispatcher.d/. It seems that until the network is setup by Networkmanager, cups can't be started...

----------

## GFCCAE6xF

You probably just needed to enable/start NetworkManager-wait-online.service (I think that is how it is named).

----------

## mani001

NetworkManager-wait-online.service was enabled and it says:

```

root@ manu $systemctl status NetworkManager-wait-online.service

NetworkManager-wait-online.service - Network Manager Wait Online

   Loaded: loaded (/usr/lib64/systemd/system/NetworkManager-wait-online.service; enabled)

   Active: inactive (dead) since lun 2013-12-16 10:38:59 CET; 19min ago

  Process: 230 ExecStart=/usr/bin/nm-online -q --timeout=30 (code=exited, status=0/SUCCESS)

 Main PID: 230 (code=exited, status=0/SUCCESS)

   CGroup: /system.slice/NetworkManager-wait-online.service

```

so....is the "(dead)" part normal? I would think so since it also says "SUCCESS"   :Very Happy:   but I'm new to systemd and hence I'm not familiar with its messages

----------

## GFCCAE6xF

I believe so, anyway, I would suggest (unless there is some configuration error on your end you may have overlooked) reporting a bug, this should work as normal, at least it does for me but the only machine I have a printer hooked up to is not a Gentoo one.

----------

## mani001

Bug report filed

https://bugs.gentoo.org/show_bug.cgi?id=494582

Hopefully, someone knowing the internals of systemd can help "fix" this...

Thanks for your help rorgoroth

----------

## salahx

I didn't even notice, but i have hte same problem. But i think i know where its coming from. There are TWO cups services: a socket activated one and standard one. The socket-activated one and the "real" one. 

The socket-activated one seemed be causing the problem. Both Fedora and Suse have removed it, Gentoo should probably do the same. 

As a workaround create /etc/systemd/system/cups.socket create with the following content

```

[Unit]

Description=CUPS Printing Service Sockets

[Socket]

ListenStream=/var/run/cups/cups.sock

[Install]

WantedBy=sockets.target

```

Then do a "systemctl reenable /etc/systemd/system/cups.socket" to get rid of the error.Last edited by salahx on Mon Dec 23, 2013 8:57 am; edited 1 time in total

----------

## mani001

That did the trick   :Very Happy: 

Thank you very much!!

Marking this as solved..

----------

