daemon change

119 views
Skip to first unread message

Heather Piwowar

unread,
May 14, 2012, 2:42:59 AM5/14/12
to total-im...@googlegroups.com
Hi Kevin, 

Could you give me a quick overview of the daemon change please?  I'm having a tough time getting it all to run.

So to use the webapp we can just do
python api.py

whereas to do load_test we also have to do
python runbackend.py 
or now
python totalimpact/backend.py
is that right?

also the provider_text_proxy stuff has daemon abilities now?

load_test is working for you in the master tip, is that right?

thanks in advance for the overview... 
h

Kevin Campbell

unread,
May 14, 2012, 5:21:25 AM5/14/12
to total-im...@googlegroups.com
Heather,

The backend and API are separate processes. You will want to run both of the following:

python totalimpact/backend.py
python totalimpact/api.py

The backend process runs all of the workers for metrics, aliases, etc. You don't need to run these as daemons, that's optional. I've removed runbackend.py now and moved all the code there into totalimpact/backend.py so it's consistent with api.py

I've got some init scripts that handle pid creation, boot up logfiles, etc. which will probably help here. I'll add them in, although we might want to move them later.

load_test is working for me on master, yes, including using the proxy for all of the external requests.

Regards,
Kevin


h

--
You received this message because you are subscribed to the Google Groups "total-impact-dev" group.
To post to this group, send email to total-im...@googlegroups.com.
To unsubscribe from this group, send email to total-impact-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/total-impact-dev?hl=en.

Heather Piwowar

unread,
May 14, 2012, 10:01:40 AM5/14/12
to total-im...@googlegroups.com
Thanks Kev, helpful.

I have the feeling I'm doing something different than you in trying to run backend.py.

On a fresh clone of master, when I do
python totalimpact/backend.py
I get an error that it doesn't import os
I add import os, then I get an error
Traceback (most recent call last):
  File "totalimpact/backend.py", line 579, in <module>
    context = daemon.DaemonContext()
AttributeError: 'module' object has no attribute 'DaemonContext'

I'm looking into it to see what might the cause of this error... just raising it here because these errors make me want to confirm that I'm doing what you are doing?  

Cheers, 
Heather

Heather Piwowar

unread,
May 14, 2012, 10:14:54 AM5/14/12
to total-im...@googlegroups.com
So no one spends any time trying to figure out this error:  it turns out 
  pip install daemon
installed the wrong library.
  pip install python-daemon 
installed the right one, and the daemon line seems to work.

Now hung up on creating the log file line... seems to be a permission problems on my directories... working on it...

Heather

Kevin Campbell

unread,
May 14, 2012, 10:16:45 AM5/14/12
to total-im...@googlegroups.com
Heather,

Let me push out any changes I have here.

Yes, it's the python-daemon package you'll need here. I've wrapped up the startup into scripts today, which should make this easier for deployment.

Regards,
Kevin

Heather Piwowar

unread,
May 14, 2012, 10:32:07 AM5/14/12
to total-im...@googlegroups.com
Sounds great.  Thanks :)
Heather

Jason Priem

unread,
May 14, 2012, 3:16:07 PM5/14/12
to total-im...@googlegroups.com
Is there a reason why this isn't included with the other dependencies in setup.py?
j
Jason Priem
UNC Royster Scholar
School of Information and Library Science
University of North Carolina at Chapel Hill

Reply all
Reply to author
Forward
0 new messages