I’ve been a happily rolling out my deployments using a script that starts with:
killall beam.smp || true … up until now.
Now, I am downscaling by running multiple phoenix servers on a single droplet, but that renders the previous hack moot. I’ve tried to use
$! to get the pid, but I guess I’m doing something wrong since it always returns
I found that running
:os.getpid returns the OS pid within Elixir, but what would be the best practice to writing that to a file somewhere, in order to stop the server later on?
The command I use to run a server is:
elixir --detached --sname logging -S mix do deps.get, compile, phoenix.server