x11vnc fails to listen to 5900/tcp after listening to 5900/tcp

Bug #1755276 reported by RoyK
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Raspbian
New
Undecided
Unassigned

Bug Description

I have Raspbian Jessie running on a number of raspberry pi's for use as infoscreens. On these, I use x11vnc with noVNC to allow people on campus to view infoscreens elsewhere. Now, upgrading to Stretch, things work well, apart from the VNC things.

x11vnc is started as the pi user with this line

x11vnc -noipv4 -6 -viewonly -shared -forever -loop -localhost -nopw -display :0 -logappend $LOGFILE &

This works well on jessie, but on stretch, it seems it's trying to listen to 5900, succeeding, and then trying to listen to the same port, obviously failing. I've tried to configure my way around it, but I really can't understand what's going on.

Someone please give me a hand…

strace output below.

roy

2331 bind(9, {sa_family=AF_INET6, sin6_port=htons(5900), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, 28) = 0
2331 listen(9, 32) = 0
2331 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=127, ...}) = 0
2331 write(2, "12/03/2018 19:29:32 ", 20) = 20
2331 write(2, "Listening for VNC connections on"..., 48) = 48
2331 rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x767f86b0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
2331 socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 10
2331 setsockopt(10, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
2331 setsockopt(10, SOL_IPV6, IPV6_V6ONLY, [1], 4) = 0
2331 bind(10, {sa_family=AF_INET6, sin6_port=htons(5900), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, 28) = -1 EADDRINUSE (Address already in use)

Revision history for this message
RoyK (roysk) wrote :

Tested on debian jessie on x64 - same thing, so this isn't raspbian specific. Now, starting it with the following options actually work.

x11vnc -noipv4 -6 -rfbportv6 5901 -httpportv6 5902 -viewonly -shared -forever -loop -nopw -display :0 -logappend $LOGFILE

Not sure if I need -httpportv6 there, apparently it's not in use, but still. According to the strace below, it correctly binds to 5901/tcp on IPv6, and then reporting

1398 write(2, "Listening for VNC connections on"..., 48) = 48

Then, later, it binds to 5900, also IPv6 like before, but reports

1398 write(2, "Listening only on IPv6 port 5900"..., 45) = 45

See below for details.

1398 socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP) = 9
1398 setsockopt(9, SOL_IPV6, IPV6_V6ONLY, [1], 4) = 0
1398 setsockopt(9, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
1398 bind(9, {sa_family=AF_INET6, sin6_port=htons(5901), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, 28) = 0
1398 listen(9, 32) = 0
1398 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2251, ...}) = 0
1398 write(2, "13/03/2018 18:00:55 ", 20) = 20
1398 write(2, "Listening for VNC connections on"..., 48) = 48
1398 rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x768926b0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
1398 socket(AF_INET6, SOCK_STREAM, IPPROTO_IP) = 10
1398 setsockopt(10, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
1398 setsockopt(10, SOL_IPV6, IPV6_V6ONLY, [1], 4) = 0
1398 bind(10, {sa_family=AF_INET6, sin6_port=htons(5900), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, 28) = 0
1398 listen(10, 32) = 0
1398 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2251, ...}) = 0
1398 write(2, "13/03/2018 18:00:55 ", 20) = 20
1398 write(2, "Listening only on IPv6 port 5900"..., 45) = 45
1398 mmap2(NULL, 1060864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7601e000
1398 poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}])
1398 writev(3, [{iov_base="b\1\4\0\10\0\0\0", iov_len=8}, {iov_base="XINERAMA", iov_len=8}, {iov_base="", iov_len=0}], 3) = 16

Revision history for this message
RoyK (roysk) wrote :

It doesn't seem much has changed on x11vnc since jessie (where it works), though. Jessie runs 0.9.13-1.2, whereas Stretch runs 0.9.13-2, so if someone knows what's happened between the two, perhaps it could help. The project is still somewhat active, but not a lot, and the versions in both jessie stretch are both flagged with "lastmode: 2011-08-10", which is a while ago…

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.