Detect OS shutdown or user logout across different operating systems

James Mills prologic at shortcircuit.net.au
Tue Apr 27 04:38:54 CEST 2010


On Tue, Apr 27, 2010 at 12:09 PM,  <python at bdurham.com> wrote:
> Is there a OS portable way to have a Python script detect when its operating
> system is shutting down or a user is logging out?

In the Linux world, you would normally create an rc/init style script
that is invoked
at boot and shutdown (usually by calling 'start' and 'stop' on the
script respectively).

This can vary from across various distributions of Linux however and is normally
something a package maintainer might do.

I am not aware of any cross-platform way of performing what you're asking.

cheers
James



More information about the Python-list mailing list