Giter VIP home page Giter VIP logo

overmind's Introduction

Overmind

Release GH Build GH Lint


Overmind is a process manager for Procfile-based applications and tmux. With Overmind, you can easily run several processes from your Procfile in a single terminal.

Procfile is a simple format to specify types of processes your application provides (such as web application server, background queue process, front-end builder) and commands to run those processes. It can significantly simplify process management for developers and is used by popular hosting platforms, such as Heroku and Deis. You can learn more about the Procfile format here.

There are some good Procfile-based process management tools, including foreman by David Dollar, which started it all. The problem with most of those tools is that processes you want to manage start to think they are logging their output into a file, and that can lead to all sorts of problems: severe lagging, and losing or breaking colored output. Tools can also add vanity information (unneeded timestamps in logs). Overmind was created to fix those problems once and for all.

See this article for a good intro and all the juicy details! Introducing Overmind and Hivemind

Sponsored by Evil Martians

Overmind features

You may know several Procfile process management tools, but Overmind has some unique, extraterrestrial powers others don't:

  • Overmind starts processes in a tmux session, so you can easily connect to any process and gain control over it;
  • Overmind can restart a single process on the fly — you don't need to restart the whole stack;
  • Overmind allows a specified process to die without interrupting all of the other ones;
  • Overmind can restart specified processes automatically when they die;
  • Overmind uses tmux's control mode to capture process output — so it won't be clipped, delayed, and it won't break colored output;
  • Overmind can read environment variables from a file and use them as parameters so that you can configure Overmind behavior globally and/or per directory.

If a lot of those features seem like overkill for you, especially the tmux integration, you should take a look at Overmind's little sister — Hivemind!

Overmind screenshot

Installation

Note: At the moment, Overmind supports Linux, *BSD, and macOS only.

Overmind works with tmux, so you need to install it first:

# on macOS (with homebrew)
$ brew install tmux

# on Ubuntu
$ apt-get install tmux

Note: You can find installation manuals for other systems here: https://github.com/tmux/tmux

There are three ways to install Overmind:

With Homebrew (macOS)

brew install overmind

With Ruby

gem install overmind

You can read about installing on Ruby On Rails [here] (https://github.com/DarthSim/overmind/blob/master/packaging/rubygems/README.md)

Download the latest Overmind release binary

You can download the latest release here.

Build Overmind from source

You need Go 1.21 or later to build the project.

$ go install github.com/DarthSim/overmind/v2@latest

The Overmind binary will be installed to $(go env GOPATH)/bin. Make sure that you added it to your PATH.

Note: You can update Overmind the same way.

Usage

In short: You can get help by running overmind -h and overmind help [command].

Running processes

Overmind reads the list of processes you want to manage from a file named Procfile. It may look like this:

web: bin/rails server
worker: bundle exec sidekiq
assets: gulp watch

To get started, you just need to run Overmind from your working directory containing a Procfile:

$ overmind start

You can also use the short alias:

$ overmind s

Specifying a Procfile

If a Procfile isn't located in your working directory, you can specify the exact path:

$ overmind start -f path/to/your/Procfile
$ OVERMIND_PROCFILE=path/to/your/Procfile overmind start

Specifying the ports

Overmind sets the environment variable PORT for each process in your Procfile so that you can do things like this:

web: bin/rails server -p $PORT

Overmind assigns the port base (5000 by default) to PORT for the first process and increases PORT by port step (100 by default) for each subsequent one. You can specify the port base and port step like this:

$ overmind start -p 3000 -P 10
$ OVERMIND_PORT=3000 OVERMIND_PORT_STEP=10 overmind start

Disabling PORT

If you don't want Overmind to set the PORT variable, you can disable it:

$ overmind start -N
$ OVERMIND_NO_PORT=1 overmind start

Running only the specified processes

You can specify the names of processes you want to run:

$ overmind start -l web,sidekiq
$ OVERMIND_PROCESSES=web,sidekiq overmind start

Not running the specified processes

Similar to the above, if there are some processes in the Procfile that you do not want to run:

$ overmind start -x web,sidekiq
$ OVERMIND_IGNORED_PROCESSES=web,sidekiq overmind start

This takes precedence over the previous -l flag. i.e. if you:

$ overmind start -l web -x web
$ OVERMIND_IGNORED_PROCESSES=web OVERMIND_PROCESSES=web overmind start

Nothing will start.

Scaling processes (formation)

By default, Overmind starts one instance of each process, but you can set the number of each process instances to run:

$ overmind start -m web=2,worker=5
$ OVERMIND_FORMATION=web=2,worker=5 overmind start

There is a special name all that you can use to scale all processes at once:

$ overmind start -m all=2,worker=5
$ OVERMIND_FORMATION=all=2,worker=5 overmind start

If you set instances number of some process to zero, this process won't be run:

$ overmind start -m some_production_task=0
$ OVERMIND_FORMATION=some_production_task=0 overmind start

Processes that can die

Usually, when a process dies, Overmind will interrupt all other processes. However, you can specify processes that can die without interrupting all other ones:

$ overmind start -c assets,npm_install
$ OVERMIND_CAN_DIE=assets,npm_install overmind start

Also, you can allow all processes to die:

$ overmind start --any-can-die
$ OVERMIND_ANY_CAN_DIE=1 overmind start

Auto-restarting processes

If some of your processes tend to randomly crash, you can tell Overmind to restart them automatically when they die:

$ overmind start -r rails,webpack
$ OVERMIND_AUTO_RESTART=rails,webpack overmind start

The special name all can also be used to restart all processes automatically when they die:

$ overmind start -r all
$ OVERMIND_AUTO_RESTART=all overmind start

Specifying the colors

Overmind colorizes process names with different colors. It may happen that these colors don't match well with your color scheme. In that case, you can specify your own colors using xterm color codes:

$ overmind start -b 123,123,125,126,127
$ OVERMIND_COLORS=123,123,125,126,127 overmind start

If you want Overmind to always use these colors, you can specify them in the environment file located in your home directory.

Show timestamps

By default, Overmind doesn't show timestamps in its output since it expects your processes to add timestamps to their own output. But you can make Overmind to add timestamps to its output:

$ overmind start -T
$ OVERMIND_SHOW_TIMESTAMPS=1 overmind start

Connecting to a process

If you need to gain access to process input, you can connect to its tmux window:

$ overmind connect <process_name>

You can safely disconnect from the window by hitting Ctrl b (or your tmux prefix) and then d.

You can omit the process name to connect to the first process defined in the Procfile.

Restarting a process

You can restart a single process without restarting all the other ones:

$ overmind restart sidekiq

You can restart multiple processes the same way:

$ overmind restart sidekiq assets

It's also possible to use wildcarded process names:

$ overmind restart 'sidekiq*'

When the command is called without any arguments, it will restart all the processes.

Stopping a process

You can stop a single process without stopping all the other ones:

$ overmind stop sidekiq

You can stop multiple processes the same way:

$ overmind stop sidekiq assets

It's also possible to use wildcarded process names:

$ overmind stop 'sidekiq*'

When the command is called without any arguments, it will stop all the processes without stopping Overmind itself.

Killing processes

If something goes wrong, you can kill all running processes:

$ overmind kill

Overmind environment

If you need to set specific environment variables before running a Procfile, you can specify them in the .overmind.env file in the current working directory, your home directory, or/and in the .env file in in the current working directory. The file should contain variable=value pairs, one per line:

PATH=$PATH:/additional/path
OVERMIND_CAN_DIE=npm_install
OVERMIND_PORT=3000

For example, if you want to use a separate Procfile.dev by default on a local environment, create .overmind.env file with OVERMIND_PROCFILE=Procfile.dev. Now, Overmind uses Procfile.dev by default.

You can specify additional env files to load with OVERMIND_ENV variable:

$ OVERMIND_ENV=./.env.local,./.env.development overmind s

The files will be loaded in the following order:

  • ~/.overmind.env
  • ./.overmind.env
  • ./.env
  • $OVERMIND_ENV

You can also opt to skip loading the .env file entirely (.overmind.env will still be read) by setting the variable OVERMIND_SKIP_ENV.

Running a command in the Overmind environment

Since you set up an environment with .env files, you may want to run a command inside this environment. You can do this using run command:

$ overmind run yarn install

Run as a daemon

Overmind can be run as a daemon:

$ overmind start -D
$ OVERMIND_DAEMONIZE=1 overmind start

Use the echo command for the logs:

$ overmind echo

You can quit daemonized Overmind with quit:

$ overmind quit

Specifying a socket

Overmind receives commands via a Unix socket. Usually, it opens a socket named .overmind.sock in a working directory, but you can specify the full path:

$ overmind start -s path/to/socket
$ OVERMIND_SOCKET=path/to/socket overmind start

All other commands support the same flag:

$ overmind connect -s path/to/socket web
$ overmind restart -s path/to/socket sidekiq
$ overmind kill -s path/to/socket

Using TCP network

Overmind can bind its command center to a TCP address instead of Unix socket. This is useful when you run it on a remote machine.

$ overmind start -s "0.0.0.0:4321" -S "tcp"
$ OVERMIND_SOCKET="0.0.0.0:4321" OVERMIND_NETWORK="tcp" overmind start

You need to pass the same flags to other commands:

$ overmind connect -s "0.0.0.0:4321" -S "tcp" web

Specifying tmux config

Overmind can use a specified tmux config. This is useful if you want to differentiate from your main tmux window, for example adding a custom status line for Overmind or a different prefix key.

overmind start -F ~/overmind.tmux.conf
OVERMIND_TMUX_CONFIG=~/.overmind.tmux.conf overmind start

Known issues

Overmind uses the system Ruby/Node/etc instead of a custom-defined one

This may happen if your Ruby/Node/etc version manager isn't configured properly. Make sure that the path to your custom binaries is included in your PATH before the system binaries path.

Overmind does not stop the Docker process properly

Unfortunately, this is how Docker works. When you send SIGINT to a docker run ... process, it just detaches container and exits. You can solve this by using named containers and signal traps:

mydocker: trap 'docker stop mydocker' EXIT > /dev/null; docker run --name mydocker ...

Overmind can't start because of a bind: invalid argument error

All operating systems have limits on Unix socket path length. Try to use a shorter socket path.

Overmind exits after pg_ctl --wait start and keeps PostgreSQL server running

Since version 12.0 pg_ctl --wait start exits right after starting the server. Just use the postgres command directly.

Author

Sergey "DarthSim" Aleksandrovich

Highly inspired by Foreman.

Many thanks to @antiflasher for the awesome logo.

License

Overmind is licensed under the MIT license.

See LICENSE for the full license text.

overmind's People

Contributors

benkoshy avatar blaedj avatar brandondrew avatar darthsim avatar dctalbot avatar deecewan avatar douglaswth avatar dsexton avatar dunkmann00 avatar envek avatar ertrzyiks avatar hsbt avatar ianmalott avatar jhnbrnn avatar joekur avatar joeytepp avatar kalekseev avatar kevinhughes27 avatar krispenney avatar maschwenk avatar mrexox avatar nikolajsen avatar piotrb avatar prog-supdex avatar sunny avatar yewton avatar zimbix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

overmind's Issues

Does overmind respond to SIGINT?

I noticed on macos that when I press Control-C (i.e. send SIGINT), overmind doesn't terminate every process (in particular, webpack-dev-server, which may well be misbehaving 😈 ). Instead overmind says "Interrupting..." but hangs forever. Running overmind kill .overmind.sock from another terminal session finishes the job perfectly though, even when it's already hanging.

So I'm wondering if overmind is intended to respond to SIGINT or if overmind kill is always needed?

Here was my Procfile (FYI Rails 5.2)

web: bin/rails server -p 3000
worker:  bin/rake jobs:work
webpacker: bin/webpack-dev-server
guard: bundle exec guard
elasticsearch: elasticsearch

PS very cool piece of software. It addresses all the gripes I had with using Foreman in a modern Rails stack (logs messed up, challenging to inject a debugger)

Update: Pressing Control-C in foreman running the same Procfile terminates the processes as expected, though the output suggests that after failing with SIGINT, it escalated to SIGKILL five seconds later.

disconnect from tmux?

I find myself connecting to a process when I want to use binding.pry or the debugger, but is there a way to disconnect the tmux window without restarting the process?

(Not a huge deal, just a nuissance when I accidentally close the tmux window)

Docker process not properly ended

Hi there!

I'm running into an issue where a docker run process, executed via a script, isn't properly killed by Overmind's SIGINT.

My Procfile reads as follows:

web: script/server
websockify: script/websockify-server

The script/websockify-server reads:

#!/bin/sh

docker run --rm -it -p $WEBSOCKIFY_PORT:80 --name websockify websockify 80 --token-plugin BaseTokenAPI --token-source "http://docker.for.mac.localhost:$PORT/internal/websockify_tokens/%s?secret=$WEBSOCKIFY_TOKENS_SECRET"

When running script/websockify-server, I can properly kill it with ctrl +c:

$ script/websockify-server
WebSocket server settings:
  - Listen on :80
  - No SSL/TLS support (no cert file)
  - proxying from :80 to targets generated by BaseTokenAPI
^CIn exit
$ docker ps --all
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

But when running overmind start and killing with a ctrl +c, the docker container is left running:

$ overmind start
system     | Tmux socket name: overmind-neptune-networks-b_4W9kfW1Ie6_NoeZnFaKO
system     | Tmux session ID: neptune-networks
system     | Listening at /Users/brooks/Sites/neptune-networks/neptune-networks/.overmind.sock
web        | Started with pid 25864...
websockify | Started with pid 25865...
websockify | WebSocket server settings:
websockify |   - Listen on :80
websockify |   - No SSL/TLS support (no cert file)
websockify |   - proxying from :80 to targets generated by BaseTokenAPI
web        | => Booting Puma
web        | => Rails 5.2.3 application starting in development
web        | => Run `rails server -h` for more startup options
web        | Puma starting in single mode...
web        | * Version 3.12.1 (ruby 2.6.4-p104), codename: Llamas in Pajamas
web        | * Min threads: 5, max threads: 5
web        | * Environment: development
web        | * Listening on tcp://localhost:5000
web        | Use Ctrl-C to stop
^Cweb        | Interrupting...
websockify | Interrupting...
websockify |
web        | - Gracefully stopping, waiting for requests to finish
web        | === puma shutdown: 2019-09-07 11:39:15 -0400 ===
web        | - Goodbye!
web        | Exiting
web        | Exited
websockify | Exited
$ docker ps --all
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                           NAMES
1bb9953982c2        websockify          "/opt/websockify/run…"   5 seconds ago       Up 4 seconds        443/tcp, 0.0.0.0:9090->80/tcp   websockify

At first I thought this may be related to docker running as PID 1 and needing a --init passed to docker run to properly capture the signal, but it's curious that everything works fine when not using Overmind.

The Dockerfile in question can be found here.

Add support for -s -e option.

Overview

Would it be possible to add a -e option to the start command for excluding processes from the Profile?

Examples

Procfile:

release: bundle exec rake db:migrate
web: bundle exec puma -C config/puma.rb
worker: bundle exec shoryuken --config config/shoryuken.yml --rails

Usage:

overmind start -e release
overmind start --exclude release

If you do this, it might be a good idea to switch the -l option to be -i instead. Example:

overmind start -i web,worker
overmind start --include web,worker

This'll make it easier for people to mentally associate with the include/exclude options.

Notes

I know overmind doesn't support the UNIX-like long option versions (i.e. --include, --exclude) but I listed them in the examples in case that's easy to add (or of interest).

At a minimum, I'd be happy if only the -e option was added as it'd make it easy ignore processes that are necessary for deployment purposes (i.e. Heroku) but not useful for development purposes.

Filters

It would be very useful to be able to type foo to filter in by that string, or -foo to filter out. It could act on the logs themselves, or the service names.

Support starting multiple processes of a given type?

Foreman supports running multiple instances of a specification. This can be useful for testing concurrent interactions and the like. The applicable flag is documented thusly:

-m, --formation
Specify the number of each process type to run. The value passed in should be in the format process=num,process=num

When the flag is used, the processes are suffixed with a number when labelling the output, e.g.:

$ overmind start -m web=2
web.1 | Started with pid 91384
web.2 | Started with pid 91385

Ability to run arbitrary commands

In foreman (http://ddollar.github.io/foreman/#SYNOPSIS) you can execute foreman run some_command_here which will set the environment variables defined in the .env file and run some_command_here. Sometimes this is useful if you store npm or rubygem configurations (NPM_CONFIG_REGISTRY) in a .env file and you want to run yarn install or bundle install.

There doesn't seem to be an equivalent feature in Overmind. Is this functionality possible, if not, would it make sense to add this in?


Example/Expectation:

// .env
NPM_CONFIG_REGISTRY=https://npm.fury.io/TOKEN/USERNAME

Running overmind run yarn install should set the env vars defined for the yarn install process when it runs just like foreman run yarn install would. Doing so would not start and execute the items defined in your Procfile of course.

Support environment variable use within .env file.

# .env
NODE_ENV=development
RAILS_ENV=${NODE_ENV}

The above doesn't work correctly. RAILS_ENV gets set to the literal value ${NODE_ENV} instead of the correct value of development.

OS: macOS 10.12.6 w/ Homebrew
tmux: 2.6
Overmind: 1.1.1

Having some strange issues with .env loading

The loading of .env in 1.0.9 is causing some strange issues for me. I use dotenv with rails, in which you have a base .env, and then environment-specific files such as .env.development or .env.production for overriding certain variables depending on which application environment you want to boot. The issue I'm seeing is that, no matter what, only the .env variables are loading. Even if I specify using OVERMIND_ENV, the variables in .env.development do not load.

Here's a very distilled example that shows the issue:

# .env
FILENAME=.env
# .env.development
FILENAME=.env.development
# Procfile
echo: echo Filename is $FILENAME
$ overmind s
echo   | Started with pid 9639...
echo   | Filename is .env
echo   | Exited

$ OVERMIND_ENV=./.env.development overmind s
echo   | Started with pid 9699...
echo   | Filename is .env
echo   | Exited

Am I doing something wrong?

Overmind ignores variables set in `.env.local` that are already set in `.env`

Firstly, Overmind is amazing! Then, it seems to make variables declared in .env immutable, and do not update them when loading .env.local.

For example, with the following config, REDIS_HOST would be redis when running the app:

.env

REDIS_HOST=redis

.env.local

REDIS_HOST=localhost

A workaround for this is running: OVERMIND_ENV=.env.local overmind s.

Multiplex-less

I use a simple script to run each item from Procfile:

grep --invert-match '#' < Procfile | sed -e 's/^[^:]*: //' | xargs -I {} tmux split-window -v \; send-keys '{}' 'C-m' && tmux select-pane -t 1 \; send-keys 'C-d' \; select-layout even-vertical

Example output for Procfile like this:

web: watch ls
workers: watch date
node: watch ls
monotor: watch date

screen shot 2017-09-28 at 17 49 57

I can selectively maximize/minimize, rearrange panes.
It's also much more convenient from the point of STDIN when all processes are run in their own panes if you decide to send signals or set breakpoints and use REPL.

Not an issue or a pull request, just would like to know what do you think.

Start the process after it dies

"Overmind allows a specified process to die without interrupting all of the other ones;"

But how to start them? If I start in another tab ".overmind.sock: bind: address already in use"
Also would it be cool if you can call commands in overmind tui and start restart connect to process right there, not in new tab/window.

Overmind displays unknown escape codes in output

Hi! I'm having an issue with Overmind in that it's showing unknown escape codes in the main overmind output. The weird thing is that when I run overmind connect to the subprocess that's outputting he escape codes, I don't see them in the output.

Basically, I'm using guard for running my unit tests when files are changed, and capybara-inline-screenshots which adds inline screenshots for users of ITerm2. In other circumstances (running guard without Overmind), this output is just ignored, but it seems like somehow Overmind is mangling the output when it embeds it so that the terminal emulator ends up showing it. It looks like this:

guard     | �]1337;File=name=c2NyZWVuc2hvdF8yMDE0LTEwLTI3LTA3LTAwLTAyLjQ1Ny5wbmc=;inline=1:iVBORw0KGgoAAAANSUhEUgAABVYAAAMACAYAAADPPjzCAAAACXBIWXMAAAsTAAALEwEAmpwYAAAgAElEQVR4nOzddVxV9x/H8ReNgoiCKCZiYeuMqdjO7u7u2tQZU2frnLNnJ3Z3O7u7+2cXYM1ApeH3h/NO5FKKwrb38/Hgsd3v+cbn3HPO9fLhe77HJDQ0NJT/iMdPn+Lk6BjXYYiIiIhIHLvn+RQnh8RxHYaIiIiIxCE/n2ef3HbkqNGYx2IsIiIiIiIiIiIiIv8Y9o4pYtxm3txZAEqsioiIiIiIiIiIyH/Xi6fen9TONJbjEBEREREREREREfnXU2JVREREREREREREJIaUWBURERERERERERGJISVWRURERERERERERD6QJJlzlHWUWBURERERERERERH5y/...

except with many, many lines of output, since it's base64 encoding a PNG image (format documented at https://www.iterm2.com/documentation-images.html).

I'm getting this output because of this: buildkite/capybara-inline-screenshot#1 but it seems like from their perspective the unknown escape codes are supposed to be ignored anyway. It's probably possible to make that library not output the inline screenshot data when the terminal is not ITerm2, but the way it is now it works inside VMs without any fiddling.

I am not sure whether the images do still get displayed with ITerm2, but it may be that it's broken there too, if the escape code is actually being mangled somehow.

If there's any way to fix this with Overmind, or to get it to ignore this output, that would be great. Thanks!

Overmind is not showing colors properly

Hello,

Thank you for the gem. I have a few issues with colors, however I'm not sure wether these are issues with my color scheme of iTerm2, tmux or overmind. I work on OS X with iTerm2. Here are my issues:

  1. When I just start sidekiq, the color of the Karate guy is red:

red-karate-guy

When I start overmind, the Karate guy is black/gray:

gray-karate-guy

  1. In foreman, different processes have different colors:

foreman-colors

In overmind, this is not the case (see second image of item 1).

So far I have only described facts and finally my question - are the two points expected behavior or are they due to some misconfiguration in my environment?

Support setting .env variables with quotes

First of all, I love this project. ❤️ ❤️ ❤️ Thank you for making it!

If I use single or double quotes to set my ENV variables in my .env file, the quotes get included in the variable's value. Pretty sure this is being caused by the Regex here:

re, _ := regexp.Compile("^(\\w+)=(.+)$")

I first thought about adding ['"]? to the Regex (like ^(\\w+)=['"]?(.+)['"]?$), but since Go's Regex doesn't support backreferences, it doesn't seem like a good solution because an ENV variable would get cut off if it contained a quote character like FOO="Sergio's App".

Maybe we check if the first and last char of env[2] are single or double quotes, and then remove them if so?

Setup

.env

FOO1=bar1
FOO2='bar2'

Procfile

process: FOO3=bar FOO4='bar' ruby print.rb

print.rb

puts ENV["FOO1"]
puts ENV["FOO2"]
puts ENV["FOO4"]
puts ENV["FOO3"]

Expected Output

system  | Listening at /Users/sergio/Desktop/overmind_test/.overmind.sock
system  | Tmux session ID: overmind-overmind-test-WDN4CZrc8B8FfBxf2zXB3Pwg0yNKeCsR
process | Started with pid 4905...
process | bar1
process | bar2
process | bar3
process | bar4
process | Exited

Actual Output

Notice how 'bar2' is showing the single quotes.

system  | Listening at /Users/sergio/Desktop/overmind_test/.overmind.sock
system  | Tmux session ID: overmind-overmind-test-WDN4CZrc8B8FfBxf2zXB3Pwg0yNKeCsR
process | Started with pid 4905...
process | bar1
process | 'bar2'
process | bar3
process | bar4
process | Exited

Tmux pane size limited to 80x24

Hi!

Thanks for the great tool! Having funny time using it last several days. Good job!

However I have a problem with pane size which limited to subject size with notice:
(size 80x24 from a smaller client)

I'm trying to resize it eg like described here with any luck.

Interesting that tmux running fullscreen when I just run it as tmux without any args. But when I connect over overmind c ... it limits size.

I'm running under Ubuntu 16.04, zsh, tmux 2.1

Any ideas?

tmux

Аналог команды kill для SIGINT?

Может реализовать команду stop как аналог Ctrl + C, а то в ряде случаев детишки сиротками остаются.

В частности вот было у pumы пара рабочих котят, если послать overmind kill, котятки-то разбегутся, и потом не запустишься пока не передушишь их ручками.

Не то, чтобы прям кушать не получается без этой команды, но как же котятки?

Hint to remove .overmind.sock

In some cases you can have a leftover .overmind.sock file but without a running overmind process. I think in my case this was caused by a computer restart while it was running. It would be nice if the error you get when trying to reboot overmind would prompt you to remove the file if you know that it's not currently running.

Current message:

overmind: listen unix /Users/joekur/dev/reverb/.overmind.sock: bind: address already in use

As an example, zeus (https://github.com/burke/zeus) gives this message:

Unable to accept socket connection.
It looks like Zeus is already running. If not, remove .zeus.sock and try again.

V2 Fish shell incompatibility?

Hello,

Thanks for making Overmind!

Since upgrading to V2 yesterday, I get an error when trying to start Overmind within my Fish shell.

system | Listening at /Users/nathan/Culturinthebox/app-ne/.overmind.sock
system | Tmux socket name: overmind-app-ne-9erZUt6RmoPFXiCmIEn0h1
system | Tmux session ID: app-ne
guard  | Started with pid 2004...
worker | Started with pid 2006...
assets | Started with pid 2003...
web    | Started with pid 2005...
assets | Failed to execute process '/var/folders/0l/cgbgptb50wj_dfbbxhqpc1jh0000gn/T/overmind-app-ne-9erZUt6RmoPFXiCmIEn0h1/assets'. Reason:
assets | exec: Invalid argument
guard  | Failed to execute process '/var/folders/0l/cgbgptb50wj_dfbbxhqpc1jh0000gn/T/overmind-app-ne-9erZUt6RmoPFXiCmIEn0h1/guard'. Reason:
web    | Failed to execute process '/var/folders/0l/cgbgptb50wj_dfbbxhqpc1jh0000gn/T/overmind-app-ne-9erZUt6RmoPFXiCmIEn0h1/web'. Reason:
web    | exec: Invalid argument
web    | The file '/var/folders/0l/cgbgptb50wj_dfbbxhqpc1jh0000gn/T/overmind-app-ne-9erZUt6RmoPFXiCmIEn0h1/web' is marked as an executable but could not be run by the operating system.
guard  | exec: Invalid argument
guard  | The file '/var/folders/0l/cgbgptb50wj_dfbbxhqpc1jh0000gn/T/overmind-app-ne-9erZUt6RmoPFXiCmIEn0h1/guard' is marked as an executable but could not be run by the operating system.
assets | The file '/var/folders/0l/cgbgptb50wj_dfbbxhqpc1jh0000gn/T/overmind-app-ne-9erZUt6RmoPFXiCmIEn0h1/assets' is marked as an executable but could not be run by the operating system.
worker | Failed to execute process '/var/folders/0l/cgbgptb50wj_dfbbxhqpc1jh0000gn/T/overmind-app-ne-9erZUt6RmoPFXiCmIEn0h1/worker'. Reason:
worker | exec: Invalid argument
worker | The file '/var/folders/0l/cgbgptb50wj_dfbbxhqpc1jh0000gn/T/overmind-app-ne-9erZUt6RmoPFXiCmIEn0h1/worker' is marked as an executable but could not be run by the operating system.
guard  | Exited
assets | Exited
worker | Exited
web    | Exited

Do you have an idea of something I can try?

Thanks,

Nathan

overmind weird behaviors

Hey all ! I'm sorry to bother you but since I upgraded overmind from 1.X to the last version (2.0.3). It behaves weirdly.

First it does not log the combined output of all commands when launched with overmind start -f Procfile.dev -p 3000.
Second, the restart does not really restart the commands, it is stuck indefinitely (tmux version 2.9a).

Did I do something wrong ? Is there something I could do to help me/you debug ?

Unable to send input to child processes

First of all, thanks for creating this! It seems like exactly what I've always wanted - a more reliable way of running tasks in a Procfile, where I can still communicate with the child processes.

Unfortunately, I just tried it out with my Rails app and I can't seem to actually communicate with any of the child processes - when I run overmind connect rails or other processes, any input I enter doesn't go to the child, it just gets echoed. When I try to send command sequences like ctrl-C, I just see ^C, and ^M when hitting enter, etc. Normally when using tmux I don't have to do anything special to send input to the child, so I'm wondering what I'm doing wrong here. Or did I misunderstand what overmind does?

Procfile is pretty generic:

rails:  bin/rails s
guard:  bundle exec guard start --no-interactions -w app config spec lib db vendor
worker: bundle exec sidekiq -C config/sidekiq.yml
mailcatcher: bundle exec mailcatcher -f --ip 0.0.0.0 --smtp-port 6666
webpack: npm run server
storybook: npm run storybook

Running Overmind 1.0.7 on a Rails 4 app on Ubuntu 14.04 inside Vagrant/VirtualBox (built tmux 2.5 from source, as it seems like the tmux 1.8 that Trusty comes with isn't supported by overmind).

Any help would be appreciated. Thanks again!

One addition: If I make a new window in tmux with C-b c, I can send input to that shell, so it seems like it's something to do with what Overmind is doing with ptys?

I also see the same behavior on my Linux host which is Ubuntu 17.04.

"width too small" error

I have an utterly strange situation.

If I run:

docker run -ti myimage

it will run fine, but if I do

docker create --name somename -t myimage

it will always fail with:

system | Listening at /app/.overmind.sock
system | Tmux socket name: overmind-app-VfOudhxLnV5Al0JUBqvAlq
system | Tmux session ID: app
web    | width too small
web    | 

I wonder if this is really moby/moby#25450 - but maybe some parameters may be passed to tmux in order to avoid it?

Tmux cannot create window in v1.1.0

Hi 👋

first of all: million thanx for this awesome project 💯

With upgrading overmind to the latest version 1.1.0 I can no longer start my services - I suspect this is due to the changes in how you changed starting tmux servers 🤔 (I'm running tmux version 2.6)

I get this tmux error:

create window failed: index in use: 0

My Procfile is pretty basic (as the error let's says, it fails on the 2nd item: redis):

web: rails s -p 3000
redis: redis-server
sidekiq: bundle exec sidekiq -C config/sidekiq.development.yml
webpacker: bundle exec rake react_on_rails:locale && ./bin/webpack-dev-server

Am I doing anything wrong? I for now downgraded to 1.0.9...

Feature request: configure the signal used to stop/restart a particular process

Erlang/Elixir apps are usually started from within Erlang or Elixir shell (erl and iex, respectively) in development. erl installs a SIGINT handler which displays the so called "BREAK" menu instead of stopping the process:

BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
       (v)ersion (k)ill (D)b-tables (d)istribution

To actually stop the shell, the user have to select the abort command (a) or send SIGINT again. Elixir shell (iex) adopts this behavior.

Consider the following Procfile which runs a RabbitMQ server and a toy Elixir app:

broker: rabbitmq-server
consumer: cd consumer && iex -S mix

Stopping processes run by this Procfile either by sending SIGINT (Ctrl+C) to the overmind process or by running overmind kill works fine because overmind also sends SIGKILL shortly after sending SIGINT (or so it seems). But in order to restart the consumer process I have to run overmind restart consumer twice.

The solution would be to send SIGQUIT instead (4.4 How do I quit the Erlang shell?). Can you add a way to specify the signal used to restart a process? Something like this:

$ overmind restart process1 [process2 process3 ...] \
      --stop-signal=process1:SIGQUIT[,process2:SIGINT,process3:SIGTERM...]
$ OVERMIND_STOP_SIGNAL=process1:SIGQUIT[,process2:SIGINT,process3:SIGTERM...] \
      overmind restart process1 [process2 process3 ...]

Support taking PORT from .env

Here is my config:

$ cat Procfile 
web: bin/rails s -p $PORT
webpack: yarn start

$ cat .env
PORT=3003

But overmind ignores the PORT from .env and I had to create .overmind.env with the same config.

$ cat .overmind.env 
OVERMIND_PORT=3003

It would be nice if it worked out of the box.

Other than that, I am super happy with overmind and thank you for creating it! It's the only issue I've ever encountered after 3 months of using it.

document order of env files

Docs say:
"If you need to set specific environment variables before running a Procfile, you can specify them in the .overmind.env file in the current working directory, your home directory, or/and in the .env file in in the current working directory. The file should contain variable=value pairs, one per line:"

Could you document in which order files will be read, as this has importance if #27 gets implemented.

Also if defining the same variable in several files (and hence overwriting/redefining it) - this has importance.

.env file parsing and escape characters/interpolation

After upgrading from 1.1.1 to 1.2.1 environment variables are parsed differently (incorrectly?).

Environment variables enclosed by single quotes (') would not be subject to interpolation in 1.1.1 but are in 1.2.1, eg:

#.env
A='VALUE'
B='$A'

With 1.1.1:

> echo $A
STRING
> echo $B
$A

With 1.2.1:

> echo $A
STRING
> echo $B
STRING

The issue I experience is that most other .env parsers do not interpolate on a single quote enclosed value. So for instance running a Ruby on Rails application with overmind or just rails s result in the application being run with different environment variables.

An option to run in detached/daemon mode

Thank you for Overmind! It is great!

Would it be feasible to add a -d/--detach option that launches overmind but doesn't automatically show the output of all commands. I'd love to have overmind running in the background, keeping things alive without needing to keep it open. Right now what I do is start overmind in a tmux session and then disconnect from it to ensure it keeps going after I close my SSH connection.

overmind connect (with no arguments) could be used to bring that back to the foreground.

This could be as simple as starting the main output in a disconnected tmux session that would show up in tmux ls

Not working well with ngrok

Hi,

overmind is not working well with ngrok.
My proc file is:

rack: rackup
ngrok: ngrok http 9292

When running ngrok (by overmind start)
1

When the overmind is stopped:
2

How it should look like when ngrok started manually with ngrok http 9292:
3

The problem is I can't see the urls ngrok is hooked to untill I stop the overmind.

Thanks

Better way to deal with unexpected termination

First, I love Overmind. Thank you for all the work!

This is a small issue, maybe solved by documentation. Most of the time, I exit overmind start via Ctrl-C (i.e., SIGINT). However, sometimes I'll inadvertently close the terminal. This leaves the processes running in a tmux session, and an orphan .overmind.sock. So, the next time I run overmind start, I get things like:

$ overmind start
overmind: it looks like Overmind is already running. If it's not, remove .overmind.sock and try again

$ pgrep -fl overmind
39965 tmux -CC ...
39966 /bin/sh /var/folders/m3/...
39967 /bin/sh /var/folders/m3/...

To recover from this, I run:

$ pkill -fl overmind; rm -f .overmind.sock 

It'd be nice if I could reattach to the running session, and/or clean it up with an Overmind command.

Allow to specify custom env file

Basically, if one has more than one .env file, it'd be great to be able to specify which file to use (i.e. foeman's -e option). Moreover, maybe I'm wrong, but when you have more than one project the global ~/.overmind.env seems to be quite a weird solution.

`bin_path': can't find gem bundler (>= 0.a) (Gem::GemNotFoundException)

Hello.

I'm using overmind 1.0.8.2 and I'm running into the following issue (whereas hivemind works fine):

$ overmind s
system  | Listening at /Users/nick/foo/.overmind.sock
system  | Tmux session ID: overmind-foo-g3jF6FDXO09mWh6GsNV2UyIZQ1TQu5Km
webpack | Started with pid 26093...
rails   | Started with pid 26096...
rails   | /Users/agis/.rubies/ruby-2.3.3/lib/ruby/2.3.0/rubygems.rb:241:in `bin_path': can't find gem bundler (>= 0.a) (Gem::GemNotFoundException)
rails   |       from /Users/agis/.gem/ruby/2.3.3/bin/bundle:22:in `<main>'
rails   |
rails   | Exited
webpack | Interrupting...
webpack |
webpack | Exited

I'm using ruby 2.3 with chruby along with the relevant activation steps in my ~/.bash_profile, notably:

source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh
chruby 2.3.3

I'm doing this from within an existing tmux session. However I also tried outside of a tmux session.

  • 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin15]
  • tmux 2.5
  • macOS 10.12.16
  • overmind 1.0.8.2 (installed with brew)
  • iTerm2 3.1.2

Again, hivemind works fine.

Thanks in advance!

High Sierra, overmind no longer exits cleanly

Since upgrading to High Sierra from Sierra, overmind no longer exits.

Processes start fine. When interrupting with ctrl+c the processes all appear to be interrupted and exit, but overmind does not stop.

> ps -e|grep overmind

60631 ??         0:00.10 tmux new -d -s overmind-xxx-B0JuToCv8O2nRqVpCe8dgaGg2nw2Wwk4 -x 80 -y 57 -n web -P -F #{pane_pid} overmind launch web bundle exec unicorn -p 3000 -c ./config/unicorn_dev.rb 5000 /Users/jeremy/src/xxx/.overmind.sock \; allow-rename off
60627 ttys000    0:00.72 overmind s
60632 ttys008    0:00.20 overmind launch web bundle exec unicorn -p 3000 -c ./config/unicorn_dev.rb 5000 /Users/jeremy/src/xxx/.overmind.sock ; allow-rename off

socket under vagrant shared volumen

Hi, I'm testing overmind and work great! but I has a little issue.

I'm working under Vagrant and by default it create a share under /vagrant pointing to the project's directory (1).
When I try to run overmind s it return an error that can't create the socket file. I assume this is because of the shared mount.

vagrant@ntfx2 in /vagrant/dev/cga/bec on master!
$ overmind s
overmind: listen unix /vagrant/dev/cga/bec/.overmind.sock: bind: operation not permitted

This obligate me to use the -s flag on every command. Could you add an environment variable to define the socket file ?

TIA

(1) https://www.vagrantup.com/docs/synced-folders/

Option to disable .env entirely

Ruby's dotenv gem already takes care of loading env files in the correct order, and it supports layering based on environment and whatnot.

Similar to #35 which solution might work, but if you use multiple layers of .local files .. like .env.development.local and such it gets cumbersome to deal with it. overmind loading ANY of the env files causes the ruby dotenv to prefer the already set ENV from outside (ie from overmind) so it ends up overriding the local configs in annoying ways.

What I'd like actually is just a way to TURN OFF loading of all the generic .env files (perhaps permit loading of .env.overmind just to allow that to perhaps set the env variable that turns off any further .env loading.

start tmux with -CC

An extension to #38

As an overmind user
I want to specify tmux startup options, specifically -CC
So i can use iTerm2's amazing tmux integration

Support Procfile.local

It would be nice to also load a local procfile. I work with a Mac, my coworker with Linux, I need to start redis, she doesn't. We write one Procfile with common services, save it on git, I write Procfile.local with redis and ignore it in git. What do you think?

tmux version compatibility

Could you please specify compatible tmux version? Seems like overmind does not work with tmux version 1.8:

$ overmind start
system  | Listening at /adjust/dashboard/.overmind.sock
system  | Tmux session ID: overmind-1KolaEDzo4WeoZvILBIdzfWlGR0U1GQL
grunt   | tmux: unknown option -- c
grunt   | usage: new-session [-AdDP] [-F format] [-n window-name] [-s session-name] [-t target-session] [-x width] [-y height] [command]
grunt   |

PORT variable gets overwritten by OVERMIND_PORT

It seems like the PORT variable is overwritten by the OVERMIND_PORT variable, which is confusing.

# .overmind.env
PORT=3000 # doesn't work, results in the default 5000

Setting the OVERMIND_PORT variable directly does work

# .overmind.env
OVERMIND_PORT=3006 # does work

.overmind.rc

As an overmind user
I want to specify a single overmind configuration
To remove special scripts that start overmind with --formation etc

I imagine the procfile and the rcfile as a manifest tuple that represents desired startup state.

Feature request: restart all

I sometimes need to restart everything, it'd be cool to say:

overmind r *

which would fit with the filters idea someone else posted. overmind r web* for example.

Session not visible in tmux session list

When starting overmind, I used to see the tmux session the list of sessions, but it's not showing anymore. This is the boot output:

system      | Listening at /Users/thejspr/Code/reklameskyen/.overmind.sock
system      | Tmux socket name: overmind-reklameskyen-5pDERsrSCEJLRsh7z~dSqK
system      | Tmux session ID: reklameskyen

Is this a known bug or an intentional change?

I'm using version Overmind v1.1.1, Tmux 2.6 on MacOS High Sierra.

Overmind overrides action cable port

Having an issue where we set the action cable domain and port in an initializer, but overmind (seemingly) keeps the domain but overrides the port and sets it to 5100.

We are starting the rails server in a procfile like this:

bin/rails server -p 3000

We're expecting action cable to be accessed on the same port

Process exiting with non-zero status should make overmind exit with non-zero

Procfile containing:
f: false

Expected behaviour:

$ overmind start
system | Listening at /tmp/.overmind.sock
system | Tmux socket name: overmind-overmind-gLAYeyr_TE38E5VIZrJAlt
system | Tmux session ID: overmind
f      | Started with pid 23069...
f      | 
f      | Exited

$ echo $?
1

Actual behaviour:

$ overmind start
system | Listening at /tmp/.overmind.sock
system | Tmux socket name: overmind-overmind-gLAYeyr_TE38E5VIZrJAlt
system | Tmux session ID: overmind
f      | Started with pid 23069...
f      | 
f      | Exited

$ echo $?
0

Optionally run processes on localhost or test TLD

I really love using Overmind for running my Procfiles and being able to use binding.pry to have nice debugging sessions! Thanks for that!

I have another problem I'm dealing with right now where I need to run a "suite" of Rails apps and services. The suite of apps and services also expect everything to run on the .localhost TLD, which creates some problems for me while I'm trying to use Overmind.

Do you have any plans of adding support for a use-case like this? From a user perspective, it seems like having an environment variable like OVERMIND_TLD could determine whether to use .test or .localhost, and not setting that environment variable means that Overmind will just default to the usual localhost:5000.

What do you think? Is there some other way to do this without manually editing my /etc/hosts file until a feature like this could become a reality?

Reconfigure tmux on overmind boot

I use tmux as my terminal multiplexer, so I thought overmind would be a great fit. But running overmind connect inside an existing tmux session results in a nested session. Nesting tmux sessions is fine, but it's only really usable if the inner and outer sessions have different prefix keys. I couldn't find a way to achieve this automatically with overmind. Here are some possible ways:

  • optionally pass -f <alternate config path> to overmind's tmux invocation, so that overmind's tmux session is configured with a different prefix from my "everyday" tmux.conf.
  • a way to run arbitrary commands at overmind launch via an rcfile of some kind, so I can run tmux send-keys to rebind the prefix
  • some other thing I haven't thought of, maybe one that already exists?

I'd be happy to open a PR to implement one of the above if a maintainer is interested!

use tmux tabs

As an overmind user
I want to start overmind with an option to connect to the tmux session with a tab for each app
So that I can monitor and interact with processes in a traditional 'TMUX' way

Additionally, this would allow me to deal with apps that send extended term escapes that clear the screen etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.