Skip to content

What does run-detach.js do? #630

Answered by jhuckaby
mikeTWC1984 asked this question in Q&A
Discussion options

You must be logged in to vote

Well, sort of. Cronicle's "detached" mode is more complicated than just that. First, it launches a "controller" (parent) script, which then launches the child job process. The parent is detached from the terminal, so it can keep running even if Cronicle itself exits, but the child job process is launched normally. This is because it needs to maintain and support the "JSON over STDIO" API interface.

So each detached job that is running has a "pair" of processes. The parent controller, and the child job process. One is detached, and one is not.

If the child job process was "detached" using the Node cp.spawn detach mode, then it couldn't write JSON to STDOUT (it would go to /dev/null), and C…

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by jhuckaby
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #629 on August 24, 2023 20:53.