FS#32173 - [rxvt-unicode] After resume from standby, urxvtd sometimes refuses connections

Attached to Project: Community Packages
Opened by Natanji (Natanji) - Tuesday, 23 October 2012, 07:29 GMT
Last edited by Sébastien Luttringer (seblu) - Monday, 29 October 2012, 12:29 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sébastien Luttringer (seblu)
Architecture All
Severity Low
Priority Low
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
I use urxvt in daemon mode (urxvtd). Since either the last upgrade or since me switching to wicd (no idea if that is related, would be weird) the client will sometimes not be able to connect to urxvtd, but just print an error message: "unable to connect to the rxvt-unicode daemon: Connection refused". I can still see urxvtd running though.

Normal urxvt works fine, of course. Only the daemon mode is problematic.

Running strace urxvtc reveals the following:
------------
mkdir("/home/user/.urxvt", 0777) = -1 EEXIST (File exists)
brk(0) = 0x168c000
brk(0x16ad000) = 0x16ad000
socket(PF_FILE, SOCK_STREAM, 0) = 4
connect(4, {sa_family=AF_FILE, sun_path="/home/user/.urxvt/urxvtd-hostname"}, 110) = -1 ECONNREFUSED (Connection refused)
dup(2) = 5
fcntl(5, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat(5, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fee02f22000
lseek(5, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(5, "unable to connect to the rxvt-un"..., 65unable to connect to the rxvt-unicode daemon: Connection refused
) = 65
close(5) = 0
munmap(0x7fee02f22000, 4096) = 0
exit_group(2) = ?
+++ exited with 2 +++

Additional info:
* package version: rxvt-unicode 9.15-3
* steps to reproduce: No idea as of yet, sorry.
This task depends upon

Closed by  Sébastien Luttringer (seblu)
Monday, 29 October 2012, 12:29 GMT
Reason for closing:  Not a bug
Comment by Sébastien Luttringer (seblu) - Wednesday, 24 October 2012, 21:47 GMT
Do you have connection refuse with netcat too?

nc.openbsd -U /path/to/your/urxvtd/socket
Comment by Sébastien Luttringer (seblu) - Saturday, 27 October 2012, 01:21 GMT
ping?
Comment by Natanji (Natanji) - Saturday, 27 October 2012, 08:39 GMT
I read your comment, but since I have no possibility to reproduce the bug as of yet, I'll have to let you wait until it happens again, for now.
Comment by Natanji (Natanji) - Saturday, 27 October 2012, 09:34 GMT
...and now it happened again.
So, I have two sockets in ~/.urxvt - the first one is called urxvtd-hostname (which according to the above is also the one used by urxvtc) and I can *not* connect to it via nc: "nc.openbsd: unix connect failed: Connection refused".

The second socket in that path is called "urxvtd-" only. I can connect to that one! I don't know what it's for, but it seems weird that there would be a second urxvtd only. Mind the minus sign at the end: looks as if the hostname was not appended there.

What's more: the command "RXVT_SOCKET=~/.urxvt/urxvtd- urxvtc" successfully spawns a urxvtc instance that is connected to urxvtd. So for some reason it seems like the urxvtd-hostname socket goes down and a new socket without the hostname part gets created and used by urxvtd instead...
Comment by Natanji (Natanji) - Saturday, 27 October 2012, 11:41 GMT
Investigating further, I *think* I may have found a possible reason for this behaviour: I had *two* lines in /etc/hostname - the first line contained my hostname AND a newline (with the second line being empty).

This sounds really weird, yes, but it might be possible that urxvt was somehow confused by this and created two sockets - one for each of the two lines. Just wildly guessing, but maybe you can try this out on your system and see if you also get two socket files in ~/.urxvt then.
Comment by Natanji (Natanji) - Sunday, 28 October 2012, 16:48 GMT
My previous assumption about /etc/hostname was incorrect. It just happened again although I fixed my /etc/hostname to only contain a single line in the meantime.

This time, I cannot run *any* programs in the existing X session anymore. When I use the "hostname" program to display my current hostname, it just prints an empty line! This is both the case inside the running X instance, and on tty1-6 as well (they also show " login" instead of "hostname login:" as a login prompt). So for some reason the system just forgets its hostname in the middle of operation.

What the fuck? How is this even possible?
Comment by Sébastien Luttringer (seblu) - Sunday, 28 October 2012, 20:55 GMT
Your issue doesn't seems related to rxvt-unicode but to your sysytem. Rights?
Comment by Natanji (Natanji) - Monday, 29 October 2012, 07:39 GMT
Yea, I guess so. I think wicd might actually be the culprit when used in conjunction with dhclient. This can probably be closed...

Loading...