I am attempting to make a little scrip that runs at startup and creates a tmux session with useful monitoring aplications.
I followed this guide to create a systemd service with the following Unit file:
[Unit]
Description=System monitoring dashboard
[Service]
Type=simple
ExecStart=/bin/bash /home/wonebone/.scripts/startup/dashboard.sh
[Install]
WantedBy=multi-user.target
The script the unit file points to is:
#! /bin/bash
#Create and name the windo
tmux new-session -d -s dashboard 'watch -n 2 sensors'
tmux rename-window 'Dashboard'
#Create the second pane running htop
tmux select-window -t dashboard
tmux split-window -h 'htop'
#Create the third pane runing iptraf and select it
tmux split-window -v 'sudo iptraf-ng'
tmux select-pane -l
#resize the pane to 75% verical and 66% horizontal
tmux resize-pane -x 66% -y 25%
When I try to attach to it throws no sessions
. If I try to list the sessions it thows no server running on /tmp/tmux-1000/default
My running theory is that the code is running before tmux is fully setup and so it can’t create the session properly.
Nuno Gardete Tribolet de Abreu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.