▲ | mikepurvis 6 days ago | ||||||||||||||||
The article is focused on interactive use, but I would be interested to also hear from folks using tmux as a process manager / dashboard for server-type environments. I was pretty unenthused about this practice when I first encountered it, but it's grown on me as a way to quickly get a sense of state from onboard a running system without having to rely on off-board dashboard or log parsers / alert systems. In particular, I'm curious about libtmux/tmuxp and how well it works to have a more declarative bringup than just a bash script launching things into the background and then attaching tmux windows to them. And I guess the broader question of whether this approach is an evolutionary dead end— like does it just become a pile of hacks as one discovers the need for restart policies, backoffs, ordering, whatever other stuff that is built into a "normal" process manager like systemd or runit? If you do end up wanting to send process stdout/stderr elsewhere or do alerting, is that now annoying if those streams are "trapped" in tmux sessions vs being written into log files or the journal? | |||||||||||||||||
▲ | accrual 6 days ago | parent | next [-] | ||||||||||||||||
> I would be interested to also hear from folks using tmux as a process manager / dashboard for server-type environments Sure! I use tmux on most of my OpenBSD systems and copy the same .tmux.conf file around, but rarely tweak it other than to set a hostname. My status bar is at the top and looks approximately like this:
* The first two windows (--) are regular shells.* The tilde window (~) is where I do stuff as root. * The message window (msg) tails `/var/log/messages` and `/var/log/daemon`, or `journalctl -f` and `journalctl -k -f` on Linux. * The auth window (auth) tails `/var/log/authlog` to monitor login attempts and usage of doas and sudo. * The pf window (pf) runs a script to monitor the packet filter rules (pass, block, match). * hostname is just the hostname. The period (.) means no mail, it turns to an exclaimation mark (!) when I have mail. * Simple date/time. This setup gives me quick access shells, important logs, mail status, date/time, and works the same on every server I manage. I add extra windows to tail other app logs as needed. | |||||||||||||||||
| |||||||||||||||||
▲ | dancek 5 days ago | parent | prev | next [-] | ||||||||||||||||
I wrote a quick and dirty bash script that launches a tmux dashboard for a legacy linux server. The team has been happy with it. It does seem like an evolutionary dead end to be honest, but it was very quick to set up. Note that the dashboard is read-only and mostly just shows journalctl for different units (we use systemd for process management). And we assume it's only used by a single user at once and everything is stopped on detach. Here's a simplified sample of setting up a 3x2 layout with some placeholder content:
| |||||||||||||||||
▲ | hnlmorg 6 days ago | parent | prev | next [-] | ||||||||||||||||
I’ve seen people use this approach (and screen too) but personally I hate it for anything other than services that are interactive but you want detachable. Eg long running installs. All the other examples I’ve seen where people have used it as a shortcut for daemonizing a service, it’s felt like just as much effort as writing a systemd service file. I guess I could forgive people more back in the days of sysv-style initd. Writing those shell scripts was seldom fun. But with systemd, it’s literally a 5 minute task. And I say that as someone who dislikes numerous decisions made regarding the approach systemd takes. | |||||||||||||||||
| |||||||||||||||||
▲ | walterlw 5 days ago | parent | prev | next [-] | ||||||||||||||||
I've used tmux like that a bunch before discovering process-compose [1]. Still use tmux a lot with remote connections and booting up a few scripts in parallel is still easier with it, but for longer-serving setups p-c has helped a lot | |||||||||||||||||
▲ | kachapopopow 6 days ago | parent | prev [-] | ||||||||||||||||
yep, that's how roughly 99.99% of major minecraft servers are ran up to this day. (and I hate migrating them) | |||||||||||||||||
|