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

Failed to run ydotoold: failed to bind socket: Address already in use #161

Closed
nlpsuge opened this issue Jun 26, 2022 · 9 comments
Closed

Comments

@nlpsuge
Copy link

nlpsuge commented Jun 26, 2022

$ ydotoold
failed to bind socket: Address already in use
fish: Job 1, 'ydotoold' terminated by signal SIGABRT (Abort)

I can't find any process related to ydotoold in the ps -ef and netstats -lnpa. So I don't know which app is using the port that ydotool uses.

@nlpsuge
Copy link
Author

nlpsuge commented Jul 16, 2022

And how I know which address and port are used by ydotool? Maybe you could also log those two info along with failed to bind socket: Address already in use?

@grigio
Copy link

grigio commented Nov 2, 2022

+1 I'm having the same issue, I've also tried to reboot but the issue persists

@richo67
Copy link

richo67 commented Nov 25, 2022

You need to delete socket file from /tmp,

sudo rm -rf /tmp/.ydotool_socket

  • of course this should be done by ydotoold on its own
  • also permissions for this socket are not really correct.
    • If I run systemd service with root than in my user account I can not connect to the socket
      • srw------- 1 root root 0 Nov 25 15:23 .ydotool_socket
    • if I run it as user then it will restart few times with message failed to open uinput device: Permission denied until I log in and than socket will be created as:
      • srw------- 1 richo richo 0 Nov 25 15:33 .ydotool_socket
  • I wonder how the system would behave if multiple people run ydotoold at the same machine at the same time.

I am not knowledgeable enough to set this properly for ydotoold to start automatically and wit correct permission as well as clean the socket at the end or kill or crash.
Hopefuly @ReimuNotMoe will have a moment to look or make sugestion.

@richo67
Copy link

richo67 commented Nov 25, 2022

I looked at the manual of this tool, as we all should do and found the solution:

*--socket-path arg*  _<path>_
	Socket path (default: /tmp/.ydotool_socket)

*--socket-perm arg* _<perms>_
	Socket permission (default: 0600)

@hugeblank
Copy link

I looked at the manual of this tool, as we all should do and found the solution:

*--socket-path arg*  _<path>_
	Socket path (default: /tmp/.ydotool_socket)

*--socket-perm arg* _<perms>_
	Socket permission (default: 0600)

I don't see how these are related to the solution, you didn't provide what the arguments should be changed to. Or are you just saying that the default values are the problem?

@richo67
Copy link

richo67 commented Dec 8, 2022

Well, I assume, that should be quite simple.

If you use option --socket-perm and you extend permission to write also for your user group, than this socket file, if existed after crash of ydotoold could be removed and recreated also by other user.

Depends how do you start the daemon ydotoold you can also place the socket into your own user's temporary folder, or leave it in /tmp (which is cleaned up at the systems reboot) and name it with your user name in it and writing permission for your user so you can also clean it after ydotoold restarts or starts again after crash.

@johngebbie

This comment was marked as off-topic.

@ReimuNotMoe ReimuNotMoe added the 1 label Jan 10, 2023
@ReimuNotMoe
Copy link
Owner

The socket error handling is improved and more user friendly in the latest release. Please test it and report any more problems in a new issue.

@nlpsuge
Copy link
Author

nlpsuge commented Jan 23, 2023

if I run it as user then it will restart few times with message failed to open uinput device: Permission denied until I log in and than socket will be created as:

You might need to enable / start the ydotoold using systemctl --user so ydotoold will run under the normal user, like

systemctl --user enable ydotool.service
and
systemctl --user start ydotool.service

I'm using ydotool to send shortcuts to a window under normal user, for more info see https://github.com/nlpsuge/gnome-shell-extension-another-window-session-manager#how-to-make-close-by-rules-work.

Rencently, ydotool works not very well though. systemctl --user status ydotool.service shows it's not running sometimes, after updating to 1.0.3, I'll see if it still has this issue.

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

No branches or pull requests

6 participants