lein-init-script icon indicating copy to clipboard operation
lein-init-script copied to clipboard

Specifying dependencies

Open bdesham opened this issue 11 years ago • 1 comments

(This is a question, not an issue.) I have a project that I’d like to launch on startup, but MongoDB needs to start before my project does. Is there a way to tell lein-init-script to add this dependency information to the generated init script?

bdesham avatar Nov 01 '13 15:11 bdesham

No, there's no way for lein-init-script to do this currently. I think the general approach to handling uses cases would be something like either of the options below. There might be other ways, but these are the first that come to mind.

  • Allow configuring an alternative to the default init script, which you could put in your project's resources dir.
  • Modify the existing default script to support some sort of "hooks". For example, you write a small bash script that exits when it detects MongoDB starts and put that little script in your resources dir. Then maybe lein-init-script has a notion of a configured "pre-start" hook, and it somehow finds your small bash script and executes it before starting the process.

Either way I think that the "wait for MongoDB" logic would be be written in a shell script. I'd be happy to consider PRs for either of these enhancements.

strongh avatar Nov 01 '13 16:11 strongh