This is the setup I use to make sure that my IRC client is running even after the host reboots.
First, we tell cron to start the session after every reboot (update 2015-03-22: this does not always work, see bottom of this post for potential remedy).
1
|
|
The actual starting of the session is done with a shell script which calles tmux a few times.
1 2 3 4 5 6 7 8 9 10 11 12 |
|
And we make tmux look and feel a bit more like screen.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Now, when I log into the shell host, I attach to my tmux session as follows
1 2 |
|
That’s it. For the most part.
Update 2015-03-22
If the @reboot
in the crontab
fails, it might be because some
things on the system need more time to come up properly after booting
(e.g. filesystems). In that case, starting the tmux session later
might help, as in the following crontab snippet:
1
|
|
This works better for me than immediately starting the
.start-tmux-auto
script, which often failed to start a tmux session.