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

Modify kill host command to forcibly remove socket #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jamesb
Copy link

@jamesb jamesb commented Sep 6, 2017

In a configuration where multiple users can host wemux, suppose user foo starts a wemux session and then ends the tmux session without using wemux stop (say, by closing all tmux windows). In this scenario, the wemux socket will be left as something like...
srw-rw-rw- 1 foo foo 0 Sep 6 10:55 wemux-wemux=
... and another user, baz, won't be able to successfully run wemux start because the server isn't running and foo owns the socket. If baz has sudo access, baz can sudo chown baz /tmp/wemux/wemux and then remove it.

The wemux script currently responds to both wemux stop and wemux kill by calling the stop_server function. In this PR, we differentiate wemux kill by attempting to forcibly change the ownership of the socket (using sudo, as above) before calling stop_server. This is convenient in a multi-tenant compute instance and should help ease some frustration when colleagues forget to cleanly stop the wemux session.

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 this pull request may close these issues.

None yet

1 participant