1

If I run

tmux kill-server ; tmux new -d -s test

Sometimes it works, and sometimes I get lost server or no server running on /tmp/tmux-1000/default.

If I do

tmux kill-server ; sleep 0.1; tmux new -d -s test

Then it always works. But I suspect it might fail on a heavily loaded system.

What's happening during that sleep 0.1 and is there a way to explicitely wait for it?

2 Answers 2

0

Inline execution of commands will not always work seamlessly reason is:

  • If you run first command which need time to execute by system.
  • And second command is dependent on it and if required same/partial resources.

It is good to have delay between inline commands. System will be as responsive as we think some time :)

0

tmux kill-server ; tmux new -d -s test with tmux kill-server && tmux new -d -s test

You want to make sure tmux kill-server succeed in order to start a new server.

It seems tmux kill-server, I experienced the same situation. Looks like it's run as a daemon and when it returns, it doesn't mean the server is killed.

2
  • 1
    I'm no longer in a position to test this, but I can't imagine why && would make a difference. The kill-server wasn't failing, it was just ending itself before the server was fully down.
    – dspeyer
    Mar 13, 2022 at 17:52
  • First how do you know if it wasn't failing? ; doesn't care about the error code. Second, it's true that kill-server doesn't wait for all the processes to be killed before returning.
    – None
    Mar 13, 2022 at 23:41

You must log in to answer this question.

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