Skip to content

Commit

Permalink
exec foreman to replace current process (#131)
Browse files Browse the repository at this point in the history
* exec foreman to replace current process

Use `exec` to invoke `foreman` to make sure `bin/dev` is replaced by the `foreman` process. This ensures that `foreman` gets `bin/dev`'s pid (so it's cleaned up properly) and that interrupts and signals (like `ctrl+c`) are handled correctly by `foreman` (to shut down child processes).

* Use sh as least common denominator shell

Some distros don't ship with bash, but will have sh.

see also: rails/cssbundling-rails#98
  • Loading branch information
titan2gman committed Dec 14, 2022
1 parent a92e492 commit 75d04a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/install/dev
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

if ! gem list foreman -i --silent; then
echo "Installing foreman..."
gem install foreman
fi

foreman start -f Procfile.dev "$@"
exec foreman start -f Procfile.dev "$@"

0 comments on commit 75d04a4

Please sign in to comment.