Hi. We're trying to automate a docker compose down...
# sst
j
Hi. We're trying to automate a docker compose down that stops local configs and the current running lambda at the same time. Right now we are basically running a "kill -9 <sst start process id>", but we are wondering if there is a much safer way to do that
r
It'd be interesting to know why you're doing it to see if there's a better approach. And where is the docker container running in relation to the lambdas?
j
for local development, the docker-compose up just starts a local postgres container and we start the dev lambda in a separate command, but they are not tied together, just share env variables to stablish the connection to stop all the local development, we run docker-compose down and look for the process that is running the current lambda, then we kill that process
r
I see, so it's for local development. You effectively need to send SIGINT which is done by using
kill -1 <procId>
My mistake, SIGINT is -2
but SIGKILL -9 would work too
I think that's your only option
j
thanks Ross. we will polish the script a little bit more. maybe in the future we have some
sst stop
or similar to stop the current live lambda
t
Do you mean you want to stop sst start or stop the child processes it spawns?
j
hi @thdxr. I've seen that it spawns a main process "... node_modules/.bin/sst start". That's the process I'm killing with SIGKILL -9. killing that process and starting again is working fine for us