11

If I run tmux as root, it runs normally and fully functional. I created a couple users, and it will not run as any of the users.

create session failed: : No such file or directory

I checked the outside $TERM is xterm and inside $TERM is screen as FAQs suggest that is most common cause of problems.

I've used tmux regularly on many different systems, but I on this VPS I can't figure out what's up... A little help, please?

EDIT: Thanks to Jay's helpful advice about strace, I found a permissions problem with /dev/pty*. I fear this won't be a useful post for many others as it seems kind of a one-off problem.

strace -f -e trace=file tmux

32000 open("/dev/ptmx", O_RDWR) = -1 EACCES (Permission denied) 32000 open("/dev/ptyp0", O_RDWR) = -1 EACCES (Permission denied) ..... 32000 open("/dev/ptypf", O_RDWR) = -1 EACCES (Permission denied) 32000 open("/dev/ptyq0", O_RDWR) = -1 ENOENT (No such file or directory)

bumbling fool
  • 321
  • 1
  • 4
  • 12

2 Answers2

10

A more general way to solve a problem of this nature:

strace -f -e trace=file tmux ..restofyourcommand...

Look for permission denied / no such file or directory errors right before it exits - might find a general reason behind why you're getting this error (that is, see what directory it was trying to create, then make it manually and observe the error, it might be that it's trying to make /home/x/some/dir without /home/x/some existing or something).

Jay
  • 6,439
  • 24
  • 34
  • Thanks for the suggestion. I'm afraid I didn't get any further. I tried messing with permissions on /var/run/tmux but didn't get anywhere. What does getcwd mean? – bumbling fool Jul 06 '12 at 15:13
  • Would you like to try with `strace -e trace=all` and paste that in? Not sure what to recommend other than that. `getcwd` just means get current working directory. – Jay Jul 06 '12 at 15:44
  • I tried to make some sense of it but I'm lost. Your continued input would be appreciated. New strace output / pastebin link edited in. – bumbling fool Jul 06 '12 at 18:58
  • 1
    I completely forgot to account for the fact that `tmux` will fork off other processes. Can you try `strace -f -e trace=file tmux ...`? You can guess what I'll ask for next if that doesn't help :-) – Jay Jul 06 '12 at 21:13
0

This happened to me because my tmux daemon process was hitting its maximum process limit.

After raising its maximum process limit (cf. Set max file limit on a running process) I was able to start my new session with tmux new-session ...

RobM
  • 155
  • 5