Re: restarting processes when python libraries are upgraded?

2011-06-20 Thread Bernd Zeimetz
Hi,

 Since python doesn't keep .py files open its hard to use things like
 checkrestart to find out which servers to restart when upgrading a
 python library for security updates. I wonder if a dpkg triggers based
 mechanism could perform this function. Any thoughts?

what about watching the pyc files instead?

Cheers,

Bernd
-- 
 Bernd ZeimetzDebian GNU/Linux Developer
 http://bzed.dehttp://www.debian.org
 GPG Fingerprints: ECA1 E3F2 8E11 2432 D485 DD95 EB36 171A 6FF9 435F


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4dff05fa.4070...@bzed.de



Re: restarting processes when python libraries are upgraded?

2011-06-20 Thread Bernd Zeimetz
On 06/20/2011 10:34 AM, Bernd Zeimetz wrote:
 Hi,
 
 Since python doesn't keep .py files open its hard to use things like
 checkrestart to find out which servers to restart when upgrading a
 python library for security updates. I wonder if a dpkg triggers based
 mechanism could perform this function. Any thoughts?
 
 what about watching the pyc files instead?

ah ignore me, now I realize what you meant :)


-- 
 Bernd ZeimetzDebian GNU/Linux Developer
 http://bzed.dehttp://www.debian.org
 GPG Fingerprints: ECA1 E3F2 8E11 2432 D485 DD95 EB36 171A 6FF9 435F


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4dff0650.9030...@bzed.de



Re: restarting processes when python libraries are upgraded?

2011-06-20 Thread Lars Wirzenius
On Mon, Jun 20, 2011 at 11:51:30AM +0800, Paul Wise wrote:
 Since python doesn't keep .py files open its hard to use things like
 checkrestart to find out which servers to restart when upgrading a
 python library for security updates. I wonder if a dpkg triggers based
 mechanism could perform this function. Any thoughts?

For packaged Python stuff, surely dependencies give sufficient
indication of what may need restarting?

-- 
Freedom-based blog/wiki/web hosting: http://www.branchable.com/


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20110620085016.ga30...@havelock.liw.fi



Intending to orphan python-psyco and python-psyco-doc

2011-06-20 Thread Alexandre Fayolle
Hello,

I've long stopped using psyco and don't have the time to give it proper care. 
Upstream (Armin Rigo) is no longer maintaining it, Christian Tismer has taken 
up the flag. The project is x86 only. 

Is there anyone wanting to take up that package ?


http://packages.qa.debian.org/p/psyco.html
http://packages.qa.debian.org/p/psyco-doc.html

-- 
Alexandre Fayolle  


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/201106201151.18160.afayo...@debian.org



Re: restarting processes when python libraries are upgraded?

2011-06-20 Thread Bernd Zeimetz
On 06/20/2011 10:50 AM, Lars Wirzenius wrote:
 On Mon, Jun 20, 2011 at 11:51:30AM +0800, Paul Wise wrote:
 Since python doesn't keep .py files open its hard to use things like
 checkrestart to find out which servers to restart when upgrading a
 python library for security updates. I wonder if a dpkg triggers based
 mechanism could perform this function. Any thoughts?
 
 For packaged Python stuff, surely dependencies give sufficient
 indication of what may need restarting?

Not necessarily. Some packages have dependencies which are only used by
a part of the modules in the package, or they have recommended packages
which are installed but not used by your daemon... and so on.


-- 
 Bernd ZeimetzDebian GNU/Linux Developer
 http://bzed.dehttp://www.debian.org
 GPG Fingerprints: ECA1 E3F2 8E11 2432 D485 DD95 EB36 171A 6FF9 435F


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4dff1a10.7070...@bzed.de



Re: restarting processes when python libraries are upgraded?

2011-06-20 Thread Lars Wirzenius
On Mon, Jun 20, 2011 at 11:59:44AM +0200, Bernd Zeimetz wrote:
 On 06/20/2011 10:50 AM, Lars Wirzenius wrote:
  On Mon, Jun 20, 2011 at 11:51:30AM +0800, Paul Wise wrote:
  Since python doesn't keep .py files open its hard to use things like
  checkrestart to find out which servers to restart when upgrading a
  python library for security updates. I wonder if a dpkg triggers based
  mechanism could perform this function. Any thoughts?
  
  For packaged Python stuff, surely dependencies give sufficient
  indication of what may need restarting?
 
 Not necessarily. Some packages have dependencies which are only used by
 a part of the modules in the package, or they have recommended packages
 which are installed but not used by your daemon... and so on.

Restart them anyway. A proper daemon will deal with restarted gracefully
and the rest can't be helped. Security upgrades are rare enough,
hopefully, that this won't be a frequent problem.

-- 
Freedom-based blog/wiki/web hosting: http://www.branchable.com/


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20110620102124.ga5...@havelock.liw.fi



Re: restarting processes when python libraries are upgraded?

2011-06-20 Thread Bernd Zeimetz
On 06/20/2011 12:21 PM, Lars Wirzenius wrote:
 Restart them anyway. A proper daemon will deal with restarted gracefully
 and the rest can't be helped. Security upgrades are rare enough,
 hopefully, that this won't be a frequent problem.

Parsing the python -v yourdaemon output might help to define a list of
packages.

python -v ./myworkproject --help 21 | grep from | sed 's,.*from ,,'

gives me a nice list of files without actually starting the daemon.
--help doesn't necessarily show all module imports depending on how the
code was implemented, but for me it works well enough.


For cases where you run code in a mod-wsgi daemon you should read
http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode

-- 
 Bernd ZeimetzDebian GNU/Linux Developer
 http://bzed.dehttp://www.debian.org
 GPG Fingerprints: ECA1 E3F2 8E11 2432 D485 DD95 EB36 171A 6FF9 435F


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4dff2981.1040...@bzed.de



Re: restarting processes when python libraries are upgraded?

2011-06-20 Thread Alexander Dutton
On 20/06/11 04:51, Paul Wise wrote:
 […] which servers to restart when upgrading a
 python library for security updates. Any thoughts?


Your Python process knows what it's got imported by looking as
sys.modules. Could your trigger prod it with some signal to tell it to
dump filenames to some well-known location? It could then check that
list for updated files.

Something like:


import os
import signal
import sys
import time

def dump_modules(signum, frame):
filenames = [m.__file__ for m in sys.modules.itervalues() if
hasattr(m, '__file__')]
with open('module_filenames.txt', 'w') as f:
for filename in filenames:
filename = os.path.abspath(filename)
f.write(filename + '\n')

signal.signal(signal.SIGUSR1, dump_modules)

while True:
time.sleep(1)



Yours,

Alex

[NB: I know very little about the Debian/packaging-side of things. I
hope to rectify this soon!]


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4dff2ddf.2010...@alexdutton.co.uk



Re: restarting processes when python libraries are upgraded?

2011-06-20 Thread Brian Sutherland
On Mon, Jun 20, 2011 at 11:51:30AM +0800, Paul Wise wrote:
 Hi all,
 
 Since python doesn't keep .py files open its hard to use things like
 checkrestart to find out which servers to restart when upgrading a
 python library for security updates. I wonder if a dpkg triggers based
 mechanism could perform this function. Any thoughts?

Havn't looked deeply at all, but perhaps the right level to do something
like this is an import hook [1]. It could probably write to some
datastructure when files are imported or even just open (and keep open)
the imported file so checkrestart works unchanged.

[1] http://www.python.org/dev/peps/pep-0302/

-- 
Brian Sutherland


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20110620131053.GA12613@Boo.local