1

I have many data-servers I need to download data from via http as soon as it is available. For each server I start a bash "while true"-loop and within that a wget to poll the server for new data. To start all the bashs I created a tmux config starting a window for every loop such loop and wget. This adds the benefit of easier inspecting what is happening.

I want to create a supervisor-service from this config, which would allow me to start, stop, and restart this tmux and its downloading clients all at once.

However, when I quit tmux, by the very nature of tmux, the bashs and their wgets keep running. Is there a way around that, so I can quit everything and restart everything with a simple supvervisorctl tmuxservice restart?

AME
  • 135
  • 6

1 Answers1

1

When you say "quit tmux", I suppose you're really quitting just a session. If you kill a tmux session all the windows in it will be shut down. For example if you started tmux with:

tmux new-session -s test1

Then you can shut it down with all its windows using:

tmux kill-session -t test1

You can create a supervisor service around your config and these commands.

janos
  • 798
  • 1
  • 5
  • 22