Discussion:
Tmux output dots continuously
Wang Sen
2015-03-11 03:13:21 UTC
Permalink
Description
========

I'm using tmux on the server side to start the os installer. I have
modified the file /etc/passwd so that the installer will be started
immediately when using ssh to login the server.

/etc/passwd :
install:x:0:0:root:/root:/usr/bin/installer

installer:
#!/bin/sh
TMUX="/bin/tmux"
START="-u -f /etc/tmux.conf start"
ATTACH="-u attach -t kvm"
export PYTHONPATH=/opt/installer/:$PYTHONPATH
$TMUX $START
$TMUX $ATTACH

tmux.conf:
set-option -g status-bg black
set-option -g status-fg white
set-option -g status-left-length 12
set-option -g status-left "KVM"
set-option -g status-right "C-right/C-left to switch"
set-option -g status-right-length 30
set-window-option -g window-status-current-bg blue
set-option -s exit-unattached off
set-option -g base-index 1
set-option -g set-remain-on-exit on
new-session -s kvm -n installer "python /opt/installer/main.py"
new-window -d -n shell "bash --login"
new-window -d -n debug "touch /tmp/installer.log && tail -f
/tmp/installer.log | grep -E '(INFO|CRITICAL)' "
bind-key -n "C-Left" select-window -t :-
bind-key -n "C-Right" select-window -t :+
detach-client -s kvm

Defect
=====

The installer works well if I use this command :

$ssh -t root@*.*.*.* installer

or :

$ssh root@*.*.*.*
#installer // on the server

But when using ssh command on the client like this:

$ssh install@*.*.*.*

the tmux was started but the screen print dots continuously.

And on the server side, it seems that the tmux attach command was executes
4 times:

$ps aux | grep tmux

root 2089 77.0 0.0 4252 2076 ? Rs 03:05 0:03 /bin/tmux
-u -f /etc/tmux.conf start
root 2093 0.0 0.0 3720 1140 pts/1 S+ 03:05 0:00 /bin/tmux
-u attach -t kvm
root 2096 0.0 0.0 3720 1140 pts/2 S+ 03:05 0:00 /bin/tmux
-u attach -t kvm
root 2098 0.0 0.0 3720 1136 pts/3 S+ 03:05 0:00 /bin/tmux
-u attach -t kvm
root 2099 0.0 0.0 3720 1140 pts/4 S+ 03:05 0:00 /bin/tmux
-u attach -t kvm

Anyone who knows what's happening and how to fix this?

*--- --- ---*
Best Wishes
Wang Sen
Nicholas Marriott
2015-03-11 08:15:24 UTC
Permalink
Try adding

set -g default-shell '/bin/bash'

to tmux.conf.

Also it is not a good idea to use /etc/tmux.conf for this because tmux
will look for it automatically, try using a different filename.
Post by Wang Sen
Description
========
I'm using tmux on the server side to start the os installer. I have
modified the file /etc/passwd so that the installer will be started
immediately when using ssh to login the server.
install:x:0:0:root:/root:/usr/bin/installer
#!/bin/sh
TMUX="/bin/tmux"
START="-u -f /etc/tmux.conf start"
ATTACH="-u attach -t kvm"
export PYTHONPATH=/opt/installer/:$PYTHONPATH
$TMUX $START
$TMUX $ATTACH
set-option -g status-bg black
set-option -g status-fg white
set-option -g status-left-length 12
set-option -g status-left "KVM"
set-option -g status-right "C-right/C-left to switch"
set-option -g status-right-length 30
set-window-option -g window-status-current-bg blue
set-option -s exit-unattached off
set-option -g base-index 1
set-option -g set-remain-on-exit on
new-session -s kvm -n installer "python /opt/installer/main.py"
new-window -d -n shell "bash --login"
new-window -d -n debug "touch /tmp/installer.log && tail -f
/tmp/installer.log | grep -E '(INFO|CRITICAL)' "
bind-key -n "C-Left" select-window -t :-
bind-key -n "C-Right" select-window -t :+
detach-client -s kvm
Defect
=====
#installer // on the server
the tmux was started but the screen print dots continuously.
And on the server side, it seems that the tmux attach command was executes
$ps aux | grep tmux
root****** 2089 77.0* 0.0** 4252* 2076 ?******* Rs** 03:05** 0:03
/bin/tmux -u -f /etc/tmux.conf start
root****** 2093* 0.0* 0.0** 3720* 1140 pts/1*** S+** 03:05** 0:00
/bin/tmux -u attach -t kvm
root****** 2096* 0.0* 0.0** 3720* 1140 pts/2*** S+** 03:05** 0:00
/bin/tmux -u attach -t kvm
root****** 2098* 0.0* 0.0** 3720* 1136 pts/3*** S+** 03:05** 0:00
/bin/tmux -u attach -t kvm
root****** 2099* 0.0* 0.0** 3720* 1140 pts/4*** S+** 03:05** 0:00
/bin/tmux -u attach -t kvm
Anyone who knows what's happening and how to fix this?
--- --- ---
Best Wishes
Wang Sen
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
tmux-users mailing list
https://lists.sourceforge.net/lists/listinfo/tmux-users
Wang Sen
2015-03-12 03:06:20 UTC
Permalink
Thanks a lot. It works for me :)

*--- --- ---*
Best Wishes
Wang Sen
Open Software Developer, China System & Technology Lab, IBM
Tel: 010-82453135
Zip:100193
Addr: Ring Buiding, 8 Dongbeiwang Western Road, Beijing
Post by Nicholas Marriott
Try adding
set -g default-shell '/bin/bash'
to tmux.conf.
Also it is not a good idea to use /etc/tmux.conf for this because tmux
will look for it automatically, try using a different filename.
Post by Wang Sen
Description
========
I'm using tmux on the server side to start the os installer. I have
modified the file /etc/passwd so that the installer will be started
immediately when using ssh to login the server.
install:x:0:0:root:/root:/usr/bin/installer
#!/bin/sh
TMUX="/bin/tmux"
START="-u -f /etc/tmux.conf start"
ATTACH="-u attach -t kvm"
export PYTHONPATH=/opt/installer/:$PYTHONPATH
$TMUX $START
$TMUX $ATTACH
set-option -g status-bg black
set-option -g status-fg white
set-option -g status-left-length 12
set-option -g status-left "KVM"
set-option -g status-right "C-right/C-left to switch"
set-option -g status-right-length 30
set-window-option -g window-status-current-bg blue
set-option -s exit-unattached off
set-option -g base-index 1
set-option -g set-remain-on-exit on
new-session -s kvm -n installer "python /opt/installer/main.py"
new-window -d -n shell "bash --login"
new-window -d -n debug "touch /tmp/installer.log && tail -f
/tmp/installer.log | grep -E '(INFO|CRITICAL)' "
bind-key -n "C-Left" select-window -t :-
bind-key -n "C-Right" select-window -t :+
detach-client -s kvm
Defect
=====
#installer // on the server
the tmux was started but the screen print dots continuously.
And on the server side, it seems that the tmux attach command was
executes
Post by Wang Sen
$ps aux | grep tmux
root****** 2089 77.0* 0.0** 4252* 2076 ?******* Rs** 03:05** 0:03
/bin/tmux -u -f /etc/tmux.conf start
root****** 2093* 0.0* 0.0** 3720* 1140 pts/1*** S+** 03:05** 0:00
/bin/tmux -u attach -t kvm
root****** 2096* 0.0* 0.0** 3720* 1140 pts/2*** S+** 03:05** 0:00
/bin/tmux -u attach -t kvm
root****** 2098* 0.0* 0.0** 3720* 1136 pts/3*** S+** 03:05** 0:00
/bin/tmux -u attach -t kvm
root****** 2099* 0.0* 0.0** 3720* 1140 pts/4*** S+** 03:05** 0:00
/bin/tmux -u attach -t kvm
Anyone who knows what's happening and how to fix this?
--- --- ---
Best Wishes
Wang Sen
------------------------------------------------------------------------------
Post by Wang Sen
Dive into the World of Parallel Programming The Go Parallel Website,
sponsored
Post by Wang Sen
by Intel and developed in partnership with Slashdot Media, is your hub
for all
Post by Wang Sen
things parallel software development, from weekly thought leadership
blogs to
Post by Wang Sen
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
tmux-users mailing list
https://lists.sourceforge.net/lists/listinfo/tmux-users
Loading...