Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

urxvtd service doesn't work first time #23193

Closed
laMudri opened this issue Feb 25, 2017 · 9 comments · Fixed by #51043
Closed

urxvtd service doesn't work first time #23193

laMudri opened this issue Feb 25, 2017 · 9 comments · Fixed by #51043

Comments

@laMudri
Copy link
Contributor

laMudri commented Feb 25, 2017

Issue description

With the urxvtd service enabled on NixOS, the first instance of urxvtc does not display anything, but keeps running. All following instances work as expected. This differs from the behaviour of not enabling the urxvtd service and just running urxvtd manually, where everything works as expected.

Steps to reproduce

Set services.urxvtd.enable = true;. Reboot and log in. Open a non-urxvt terminal and run urxvtc from it.

I'm running on XFCE with XMonad, and the problem has been reproduced on plain XMonad.

Technical details

  • System: 17.03.git.183eeb3 (Gorilla)
  • Nix version: nix-env (Nix) 1.11.6
  • Nixpkgs version: "17.03.git.183eeb3c0f"

/cc @siddharthist @rnhmjoj

@rnhmjoj
Copy link
Contributor

rnhmjoj commented Feb 26, 2017

Uhm, I can't reproduce it with either bspwm or no window manager. I will try XMonad later.

update: Just tested with XMonad and negative.
Are you sure you don't have anything else interfering? Can you test it in a VM?

@LSLeary
Copy link

LSLeary commented Mar 18, 2018

I just encountered this issue on a fresh install of nixos-minimal-18.03pre130932.cc4677c36ee-x86_64-linux. I'm also using xmonad, though it might be unrelated.

On boot, ps -e | grep urxvt shows nothing. Upon opening xterm and running urxvtc, no new window opens but nor does the command return anything; it continues to run the job. Now if I open another xterm and run ps -e | grep urxvt again I see both a .urxvtd-wrapped and a urxvtc instance, and running urxvtc now spawns a new terminal window as expected.

Earlier when I ran nixos-rebuild switch I got a torrent of warnings for collisions, I think between with-unicode3 and with-unicode3-with-plugins, even though I've never put the latter in my config. Don't know if it's related. I've since GC'd and cleared old profiles, and the warnings were not reproduced on my most recent nixos-rebuild switch.

Edit: actually I got the collision warnings again, so that's still a thing.

@rnhmjoj
Copy link
Contributor

rnhmjoj commented Mar 18, 2018

I have had this too for a while now but I had forgotten about this issue.
I couldn't figure out what's the cause. I'll try investigating some more.

@baracoder
Copy link
Contributor

Is the problem still there with 18.09?

@rnhmjoj
Copy link
Contributor

rnhmjoj commented Oct 25, 2018

@baracoder Yes, unfortunately it's still here.

@fishyfriend
Copy link
Contributor

fishyfriend commented Nov 25, 2018

I looked at this on NixOS 18.09 under XMonad. I think the issue is that urxvtd is not compatible with socket activation. When urxvtd starts, instead of listening on the socket provided by systemd, it creates its own fresh socket file at the same path ($RXVT_SOCKET), replacing the old one. So when you start urxvtc the first time, it hangs because it's connecting to systemd's original socket whereas urxvtd has created and bound to a different one. When you start urxvtc a second time, the issue does not occur since urxvtd is already running (urxvtd creates a new socket only once, when it starts up).

To verify I used these shell commands:

systemctl --user stop urxvtd.service urxvtd.socket
systemctl --user start urxvtd.socket
ps -ef | grep urxvtd               # urxvtd is not running
stat --format %i "$RXVT_SOCKET"    # prints the inode of the socket file
urxvtc                             # hangs, kill it with Ctrl-C
ps -ef | grep urxvtd               # now urxvtd has started
stat --format %i "$RXVT_SOCKET"    # socket inode has changed
urxvtc                             # works as normal
stat --format %i "$RXVT_SOCKET"    # socket inode has not changed

Checking rxvt-unicode source code confirms that it intends to delete the existing file at $RXVT_SOCKET.

@fishyfriend
Copy link
Contributor

@siddharthist @rnhmjoj I have submitted a PR to fix this by removing the urxvtd socket activation.

@cryptix
Copy link
Contributor

cryptix commented Nov 26, 2018

@fishyfriend thanks for figuring this out! tiny nit-pick the link to source code is wrong.

@fishyfriend
Copy link
Contributor

@cryptix whoops! Fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants