Hi, I'm running tmux 1.6 on centos 5 & 6 servers. We have several processing servers that run non-daemon scripts on boot that process data. In the past this was done by using cron to start the script in a screen process at boot and then detach. The scripts need to be started in a window session as they output data to the terminal as they run. Screen has issues, I would like to migrate over to tmux. However i'm getting undesirable results with tmux at boot. I have five separate scripts that I would like to have running in separate sessions. Tmux is dumping all the commands from the separate startup scripts into one session.
Here is a sample crontab of the account running the scripts: # Crontab for user # @reboot /home/user/bin/data_server.cron @reboot /home/user/bin/status_server.cron @reboot /home/user/bin/tsched.cron @reboot /home/user/bin/transfer_local.cron @reboot /home/user/bin/waitd.cron Here is a sample of the crontab script that is starting the tmux sessions each of the crontab script are the same except pointing to different scripts and startup directories: # Start the tmux session tmux new-session -d -s data_server # Make sure we are in the tumx session tmux select-pane -t data_server # Set up the paths and environmental variables. tmux send-keys "source /home/user/.bashrc" C-m # Change to the working directory: tmux send-keys "cd /home/user/bin" C-m # Run the data server script. tmux send-keys "/home/user/bin/data_server.bash" C-m After boot if I list the tmux sessions I only get the first one that was run: $ tmux ls data_server: 1 windows (created Tue Dec 3 10:00:07 2013) [80x23] If I connect to the session I find that all of the cron startup scripts tried to run in the first tmux session and ignored the new-session and select-pane commands: source /home/user/.bashrc source /home/user/.bashrc source /home/user/.bashrc source /home/user/.bashrc cd /home/user/status/status cd /home/user/bin/ cd /opt/teras/bin/ /home/user/status/status_server/status_server.rb /opt/teras/bin/tsched /home/user/bin/transfer_local.bash cd /home/user/AVO/bin /home/user/AVO/bin/data_server.rb $ source /home/user/.bashrc $ source /home/user/.bashrc $ source /home/user/.bashrc $ source /home/user/.bashrc $ cd /home/user/AVO/avo-status/avo-status bash: cd: /home/user/status/status: No such file or directory $ cd /home/user/bin/ [user@dev-proc bin]$ cd /opt/teras/bin/ [user@dev-proc bin]$ /home/user/status/status_server/status_server.rb (error removed from stating in the wrong directory) $ /opt/teras/bin/tsched I might be able to fix this problem using one crontab script to start everything, but we would like to keep them as separate crontab scripts so that they can be individually be turned on and off at startup. If tmux can be set up right at boot ideally I should be seeing : $tmux ls data_server: 1 windows (created Tue Dec 3 10:00:07 2013) [131x41] tsched: 1 windows (created Tue Dec 3 10:52:34 2013) [131x41] status_server: 1 windows (created Tue Dec 3 10:52:22 2013) [131x41] transfer_local: 1 windows (created Tue Dec 3 10:52:29 2013) [131x41] waitd: 1 windows (created Tue Dec 3 10:52:40 2013) [131x41] Here is our .tmux.conf script included for reference. # Change the prefix key from (ctrl b) to (ctrl a) set -g prefix C-a unbind C-b bind C-a send-prefix # Define the tmux environment set-option -g default-shell "/bin/bash" set-option -g default-command "bash -l" set-option -g default-path $HOME set-option -g default-terminal "screen-256color" # Set a reminder for detaching in the bottom of the window set -g status-right 'ctrl+a d - detach | ctrl+a ? - help (q)' --------------------------------- Donavan Kienenberger V-ADAPT Systems Administrator Volcanic-Ash Detection, Avoidance and Preparedness for Transportation ------------------------------------------------------------------------------ Sponsored by Intel(R) XDK Develop, test and display web and hybrid apps with a single code base. Download it for free now! http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users