Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Events for startup/shutdown?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Andreas Jung  
View profile  
 More options Jan 25, 2:11 am
From: Andreas Jung <li...@zopyx.com>
Date: Fri, 25 Jan 2013 08:11:12 +0100
Local: Fri, Jan 25 2013 2:11 am
Subject: Events for startup/shutdown?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi there,

any chance to capture the startup and shutdown of a Pyramid service?
I want to capture start/stop of Pyramid as event in our central
monitoring service.

Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQGUBAEBAgAGBQJRAjAQAAoJEADcfz7u4AZjWZoLwK/2BL87GEnxLvf3o4o9lCjc
u1TL1koYaTKR9fA1NAKh/jaRM83s6d7qrFXhQVikG1TbSk0a0ZMoyzVPDE3GXkZn
SEA1WAtHa9qRvHg0lDX4VFT/uDY2nCS6DotLnWVFY38ezI6RMbI5objqtcSs6wbX
jFuIp26hXD2z6AGPRbwq5J06jEkfkBsu1aCtgRNsdmfgLY084tSzCh9duwbV6eD6
BgJzTnzHLUfGreqt0Nibxuj/Nqa7S6ko8s6fxqwPnN0Fy3d2Yej3Z/NxjCOEwKwb
z4qww7tYDUdFNDN0QOXK+EDFT0akJlOV6EUdYs0eHWBsjaVZz/lUucZTOv9PcwMg
kKEHBzNgLo6bH8OcIaVFCngmARJeO4sM8A6mL2VmYbYD//+0dnVaMm3v1++q6BRL
fX87E+tzW2ZIhtxzJ4sdBlF+y4EkGIvs8PCOegO0EdlOXU5V/59wPXrizDGyUFK2
xmQ45YwFkS/jR1tYWkwl/we8LBLMsXk=
=rD7D
-----END PGP SIGNATURE-----

  lists.vcf
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Merickel  
View profile  
 More options Jan 25, 2:32 am
From: Michael Merickel <mmeri...@gmail.com>
Date: Fri, 25 Jan 2013 01:32:22 -0600
Local: Fri, Jan 25 2013 2:32 am
Subject: Re: Events for startup/shutdown?

WSGI is a pure request-level protocol, it does not handle or care how it is
served. As a result, a WSGI app (such as Pyramid) has no concept of when
the service begins or ends. The closest you'll get to this is a startup
hook such as your main() or ApplicationCreated for tracking the start. The
other option is to hope that your server has hooks that can be used to
track this. Finally, process state can be monitored externally via
supervisor or some other process monitor.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andreas Jung  
View profile  
 More options Jan 25, 3:45 am
From: Andreas Jung <li...@zopyx.com>
Date: Fri, 25 Jan 2013 09:45:24 +0100
Local: Fri, Jan 25 2013 3:45 am
Subject: Re: Events for startup/shutdown?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Merickel wrote:
> WSGI is a pure request-level protocol, it does not handle or care how
> it is served. As a result, a WSGI app (such as Pyramid) has no
> concept of when the service begins or ends.

As Zope veteran, I know :-) I am asking about the backend, not the WSGI
level.

> The closest you'll get to this is a startup hook such as your main()
> or ApplicationCreated for tracking the start.

ACK for the startup

> The other option is to hope that your server has hooks that can be
> used to track this. Finally, process state can be monitored
> externally via supervisor or some other process monitor.

I am still missing for the shutdown phase. Supervisord...is an option
but I want to have something in my app. I tried using an atexit handler
but it is never executed.

- -aj

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQGUBAEBAgAGBQJRAkYjAAoJEADcfz7u4AZjVT8LwJHlrJygPxj/Ro3UOS0W6BNO
aJM+4T0Eg9hyMxhBOiHgBhY3rmJlRQYWvpH8zvlFMLbXaTU4bT+Ez2xxIiNhJDRx
6RMt3+YiVOC5Ab703tG9KGSIDELEHtJicXE6RVBDEHWD7wFFXOBD/lfDgTbe8Blq
ZBgP3QVXHJL5sRkaYbRnUIpNbWnoXh5mYsRVHaZgiSilG7LReS6Ru+njSQ2y+4oy
s70GtNqFj/edm+coJd1dLxbyZxvo98gXLyNpxN4ZpYCkCDEtq/7glx2bEGgJLieV
pVNs6byRRQeJIvsUd9tNOpkBVPLAXM98pHRfvkSXCqV4sGJz9auPzxacu8kr2On5
w3jAQ970jrer+avgt3S7AhQRDCeq+Ww+m2OPuRJQwmPDgs2RiIUYg6XoP1MDm0ds
kU1UX98a4qWkmV5CXGLGProii6edQpE2GFOooZi6jZcNtvrJrVK7E7RXRZlfnu5q
xLllNy/mMApsKaPqkfbyoroPqg6GrJc=
=FSG7
-----END PGP SIGNATURE-----

  lists.vcf
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Luis Aguirre  
View profile  
 More options Jan 25, 5:41 am
From: Luis Aguirre <aguir...@xuar.com.ar>
Date: Fri, 25 Jan 2013 07:41:15 -0300
Local: Fri, Jan 25 2013 5:41 am
Subject: Re: Events for startup/shutdown?

Hi Andreas,

You may capture signals from python to get the shutdown.  Using SIGINT is
the most common way to stop an application gracefully.  You may see an
example here:
http://stackoverflow.com/questions/1112343/how-do-i-capture-sigint-in...
 .

Best regards,

Luis Aguirre

2013/1/25 Andreas Jung <li...@zopyx.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andreas Jung  
View profile  
 More options Jan 25, 10:14 am
From: Andreas Jung <li...@zopyx.com>
Date: Fri, 25 Jan 2013 16:14:46 +0100
Local: Fri, Jan 25 2013 10:14 am
Subject: Re: Events for startup/shutdown?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Problem solved for now. My atexit.register() handler is now called
when I used pserve without --reload option. Using --reload cause
the handler being ignored.

Andreas

- --
ZOPYX Limited         | Python | Zope | Plone | MongoDB
Hundskapfklinge 33    | Consulting & Development
D-72074 T�bingen      | Electronic Publishing Solutions
www.zopyx.com         | Scalable Web Solutions
- --------------------------------------------------
Produce & Publish - www.produce-and-publish.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQGUBAEBAgAGBQJRAqFlAAoJEADcfz7u4AZj/qULwKNYlF/cTnOPmw78KZOX4Hap
t6EJH2aGFbqoMcsw8WOvAkyiqrT0VHDJBxYcUbOyhdeXY7lpB9S+GttG09wRuOdK
50+nu1LcchgsPL38ZHCrgJpHGagPDlKThH5SaUuI1akVq7EZwCfoTFGOGJWWuxcN
wplfQqFyHF+889ArSnhUwgOs2tCkaUMO5N7569TsU2/3TYv1NhajIop3Maw95hUu
9ygovVHfNhCMIXDe4B4A4GfmdLADbnOVUOoEVy+SkN3D3RvyGISXNV9NwKHa9B1k
zG3G2/ibmcwEmMVCOfIVZY4p19XrP81iZQ2mjPp8j/B9KNhmT4c1x9mE8gu3wAr8
E0yyc2gkrJh1Ol8p/yoEOtTNBqw06x7YBMU1RhI/bmjwWVI7VaMXQStqU7MPXUen
IJ5p4xuCb8Ui559vQd23q/3Pe26MK6jnMGOpftzVEh+CJQwz9TlwrAcqAaBkOZpn
kGkM95PC4NrZ/apsH4GrLVFe64dcapg=
=9h/i
-----END PGP SIGNATURE-----

  lists.vcf
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »