[Cialug] Starting two jobs at once

Matthew Nuzum newz at bearfruit.org
Tue Nov 27 22:39:14 CST 2012


On Nov 27, 2012, at 9:52 PM, Matthew Nuzum <newz at bearfruit.org> wrote:

> 
> Well, for the original use-case I've tried this and it works perfectly!
> 
> run:
>    $(MONGO) --dbpath=. &
>    $(MANAGE) runserver 0.0.0.0:8000
>    kill $! && fg


I lied but found another short-term solution. As it turns out, ctrl+c to kill Django actually kills the Makefile which in turn kills Django. However it doesn't kill the background mongo process.

I did find the -j which lets you run multiple jobs in parallel.

mongo:
    $(MONGO) --dbpath=.

runserver:
    $(MANAGE) runserver 0.0.0.0:8000

run:
    $(MAKE) -j2 mongo runserver

Then doing this:

    make run

Does just what I want it to. So now my short-term solution does work. Also, it allows me to run more jobs, for example I could do -j3 sass mongo runserver. I still think the Foreman tool is too darn cool to not try out.

-- 
Matthew Nuzum
newz2000 on freenode, skype, linkedin and twitter

♫ You're never fully dressed without a smile! ♫


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4136 bytes
Desc: not available
URL: <http://cialug.org/pipermail/cialug/attachments/20121127/a62628f2/attachment.bin>


More information about the Cialug mailing list