9

I have killed a byobu session accidentally (kill -9 byobuSessionId), and now when I try to start another byobu command fails with "can't create socket".

Also tmux new-session returns: "can't create socket"

I have tried sudo service screen-cleanup start without success !

Any idea how can I solve it ?

9 Answers 9

12

Problem occurs maybe by dead tmux process if you check output for strace -f -e trace=file tmux command.

You see socket file created by tmux, in my case is located on /tmp//tmux-1001/default/

You simply delete this file and run again byobu command.

6

Check the permissions of the /tmp/tmux*/ directories. They should be owned by you and not accessible to anyone else.

So change permission as:

chmod 700 -R /tmp/tmux*

It is important that the socket directory is owned by you and not accessible by everyone, or any user could use your tmux server. For a while, tmux incorrectly skipped the access mode check, this was fixed in 2.0.

If your system doesn't support creating directories in /tmp with the right ownership, you will have to use -S to point it explicitly to a socket. The check is important and we are not going to support systems that do not have Unix file permission semantics.

1

I encountered the same problem and below is my solution:

  1. Create a new folder: /tmp/$(id -u)
  2. Change owner: chown -R $(id -nu):$(id -nu) /tmp/$(id -u)
  3. Change permission: chmod -R 700 /tmp/$(id -u)

It works!

1

I had the same issue, but it is because of disk space issue.

1

on mac the those cmds did the trick:

sudo rm -r '/tmp/tmux-'$(id -u)
sudo chmod -R 4777 /tmp/
0

I've came across the same issue on a shared server, where I had no special permissions outside my home directory. It happens that tmux was trying to access ~/tmp folder where to create its socket. That folder was not present and thus the error.

The solution on my case was to create the folder ~/tmp and all started working fine.

0

Try using this command systemd-tmpfiles --create. It creates some required folders under /run including tmux.

0

The permission of /tmp may causes this problem.

You can check whether the permission of /tmp is 4777, if not do this:

$ sudo chmod 4777 /tmp
2
  • 1
    /tmp should have 4777 (it needs the +t flag). Without it, everybody will be able to delete the files and rename the files or directories of the others below /tmp. Furthermore, it is a magician-like answer ("do X, you get Y" - but no explanation).
    – peterh
    Feb 16, 2017 at 14:57
  • @peterh Thanks for reminding me for the permission.
    – Honghe.Wu
    Feb 16, 2017 at 16:29
-1

Using command strace -f -e trace=file tmux you can see what files tmux called. Problem is ofted caused by permissions on /tmp folder. On a standard installation of Ubuntu Server permissions are set to 777. You can change with

sudo chmod 777 /tmp

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .