ga-wdi-boston / rails-api-template

A template for starting projects with `rails-api`
Other
14 stars 130 forks source link

Create a script for process cleanup #47

Open raq929 opened 7 years ago

raq929 commented 7 years ago

Per @jrhorn424 The last few cohorts have sometimes run into issues with hanging processes, particularly in the rails-api series where we often have more than one rails server being started.

We'd like to have a script that will kill all ruby processes. Maybe rake clean?

gaand commented 7 years ago

Is this sufficient ❓

killall ruby
raq929 commented 7 years ago

Likely!

jrhorn424 commented 7 years ago

I'd like to show you some of the processes running on my machine. killall spring does not work for spring. I also have several ruby-related processes running that don't get killed with killall ruby and I'd like to know what they are.

gaand commented 7 years ago

spring runs in ruby, so killing ruby is the way to go. For some errant processes, killall may need the --signal option. Use with caution when KILL.

raq929 commented 7 years ago

What kind of caution?

On Wed, Feb 15, 2017, 8:50 PM Antony Donovan notifications@github.com wrote:

spring runs in ruby, so killing ruby is the way to go. For some errant processes, killall may need the --signal option. Use with caution when KILL.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ga-wdi-boston/rails-api-template/issues/47#issuecomment-280204482, or mute the thread https://github.com/notifications/unsubscribe-auth/ANRw2PsZoF2BPCR6WJQj8t4NbVJfWwT2ks5rc6tzgaJpZM4L55jL .

gaand commented 7 years ago

KILL is serious.

I just looked and the spring gem changes the process name to spring ... so you need to use killall -m '^spring' which will match the initial substring.