Open humorless opened 5 years ago
Hi, I'm not an expert on this but I think this has something to do with how output streams are handled: nohup
fails to detect a terminal when running inside LambdaCD so it doesn't redirect the output to nohup.out as it usually does. This seems to block the shell from finishing. Also, for some reason, it only worked for me when I didn't link cd
and nohup
with &&
, no idea why.
But this seems to work:
cd ~/backend
nohup java -Dconf=~/backend/config.edn -jar ~/backend/clj-crm.jar > logfile.txt 2>&1 &
I used the bash library in lambacd to invoke my deployment script.
I put a very simple
deploy.sh
with certain code snippet like this:It looked normal to me, but in practice, the
deploy
never finished. When I took a look frompstree
. I saw something likeIt looked like deploy.sh was blocked by my service. However, I have used nohup command and &.
I changed my code snippet to something like:
This time, the deploy could successfully finish, was not blocked by java service anymore. However, I still do not understand why.