This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-06
Channels
- # architecture (2)
- # aws (6)
- # bangalore-clj (3)
- # beginners (7)
- # boot (29)
- # cider (26)
- # cljs-dev (52)
- # cljsrn (1)
- # clojure (249)
- # clojure-dev (9)
- # clojure-italy (2)
- # clojure-norway (3)
- # clojure-russia (178)
- # clojure-uk (30)
- # clojureremote (6)
- # clojurescript (91)
- # core-async (4)
- # cursive (8)
- # datascript (3)
- # datavis (1)
- # datomic (6)
- # emacs (3)
- # figwheel (2)
- # hoplon (14)
- # incanter (6)
- # luminus (8)
- # mount (7)
- # off-topic (22)
- # om (25)
- # onyx (41)
- # pedestal (7)
- # re-frame (9)
- # ring (1)
- # spacemacs (4)
- # sql (1)
- # uncomplicate (1)
- # unrepl (37)
- # untangled (90)
- # yada (77)
Is there a Unix tool that starts a daemon, optionally waits for it to listen on a port, then starts another process? When the second process exits, the tool should automatically kill the daemon.
i expect that's within the capabilities of djb's daemontools (what most non-systemd init scripts use). i'd recommend the bash.
Looks that ansible can do that. http://docs.ansible.com/ansible/wait_for_module.html (some other modules to stop/start if/already)
Unix tool... nc
can do the wait_for
part, then combine your systed services/init scripts ...
You mean like systemd
? https://www.freedesktop.org/software/systemd/man/systemd.socket.html
I think that systemd itself will not "wait for a port", it "wait for a unit".
One aproach was create a systemd service with nc --please-wait-localhost:3000
, then another service that requires the finish of nc
service. Maybe nc
should kill your service's service too..
totally missed this comment thread
thanks for the suggestion, it all seems more complicated than it should
it's pretty easy to write a python script that does this, so I think I'll go that route
I suspect this can be achieved with a bash script but unless there's a battle-tested bash solution out there I'd rather not roll my one.
@pesterhazy supervisord ?
@ejemba it starts a separate daemon, which is not what I want; I'd like the tool to exit when the job is done
I've actually used supervisor for this kind of thing in the past, and it worked, but it's a bit messy for the simple task I want to accomplish
I envision a single-minded tool written in rust that does only this 🙂
or go yes
what should I search for though?