Ask Your Question
0

Why systemd is listening on port 631?

asked 2012-07-10 13:13:21 -0600

JasonBrown gravatar image

updated 2012-07-11 03:11:34 -0600

Hello,

This is my first time running a recent Fedora. Till recent I was more involved with Debian based Linuxes. Anyway, first thing I check after fresh install is open TCP/UDP ports. On Fedora 17 I see the following picture:

# lsof -i -n | egrep 'COMMAND|LISTEN'
COMMAND    PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
systemd      1   root   47u  IPv6  13430      0t0  TCP *:ipp (LISTEN)
cupsd     1464   root    4u  IPv6  13430      0t0  TCP *:ipp (LISTEN)
cupsd     1464   root   12u  IPv4  20275      0t0  TCP 127.0.0.1:ipp (LISTEN)
sendmail  2633   root    4u  IPv4  60236      0t0  TCP 127.0.0.1:smtp (LISTEN)
# netstat -ltunp|grep LISTEN
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      1464/cupsd          
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2633/sendmail
tcp6       0      0 :::631                  :::*                    LISTEN      1/systemd           

I want to know if systemd really needs to have open IPv6 socket e.g. can I disable it somehow somewhere?

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
3

answered 2013-02-14 10:39:14 -0600

lennart gravatar image

systemd is listening on CUPS' behalf on that socket. It will never read anything from that socket though, that's only done by CUPS.

if you want systemd and CUPS to stop listening on this port use "systemctl stop cups.socket" and "systemctl disable cups.socket".

edit flag offensive delete link more
1

answered 2012-07-11 03:10:31 -0600

JasonBrown gravatar image

updated 2012-07-11 03:18:19 -0600

OK. Apparently I had to look in /etc/systemd/system/sockets.target.wants/. I removed one line from <file>cups.socket</file> file. The line was: ListenStream=631. And the result I get now is as follows:

tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      0          20588      1444/cupsd          
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      0          23426      1794/sendmail
tcp6       0      0 ::1:631                 :::*                    LISTEN      0          20587      1444/cupsd  

Which seems to be better from my perspective. But now cupsd listens to IPv6 socket. Why?

edit flag offensive delete link more
0

answered 2012-07-10 15:25:03 -0600

mooninite gravatar image

updated 2012-07-10 15:29:35 -0600

You see systemd listening because systemd handles socket activation. Instead of the service listening systemd does the listening. For further information please read systemd documentation or blog articles from the systemd author.

http://0pointer.de/blog/projects/socket-activation.html

http://0pointer.de/blog/projects/socket-activation2.html

Fedora Packaging Systemd Socket activation

edit flag offensive delete link more
0

answered 2013-09-14 19:05:02 -0600

zbyszek gravatar image

I removed one line from <file>cups.socket</file> file. The line was: ListenStream=631 But now cupsd listens to IPv6 socket. Why? Cups can also open sockets on its own, it is not limited to the ones opened by systemd on its behalf. So if you removed the TCP socket from the .socket systemd unit, cups probably opens a TCP sockets on localhost on its own. And then it opens on all available addresses, so both ipv4 and ipv6.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-07-10 13:13:21 -0600

Seen: 7,195 times

Last updated: Sep 14 '13