Skip to content
This repository was archived by the owner on Jun 15, 2024. It is now read-only.
This repository was archived by the owner on Jun 15, 2024. It is now read-only.

It is tricky to write a deploy.sh which can invoke a service and finish normally #196

@humorless

Description

@humorless

I used the bash library in lambacd to invoke my deployment script.

(defn deploy [args ctx]
  (shell/bash ctx (:cwd args) "./deploy.sh"))

I put a very simple deploy.sh with certain code snippet like this:

cd ~/backend && nohup java -Dconf=~/backend/config.edn -jar ~/backend/clj-crm.jar &

exit 0

It looked normal to me, but in practice, the deploy never finished. When I took a look from pstree. I saw something like

--- deploy.sh --- java ...

It looked like deploy.sh was blocked by my service. However, I have used nohup command and &.

I changed my code snippet to something like:

tmux new-session -d -s backend 'cd ~/backend && java -Dconf=~/backend/config.edn -jar ~/backend/clj-crm.jar'

exit 0

This time, the deploy could successfully finish, was not blocked by java service anymore. However, I still do not understand why.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions