> Den 14. sep. 2016 kl. 23.00 skrev Krešimir <[email protected]>:
> 
> Thank you, dear Sir!
> 
> I have tried as-user-atexit and it does not work with Ctrl+c event. Don't 
> know about other exit events since my machine powers the light in question. 
> So the light goes off when machine goes off anyway.

You *might* be able to wrap the UWSGI event loop to catch KeyboardInterrupt, 
and set up a signal handler for SIGTERM, SIGABRT etc, but it seems a wee bit 
overkill for your needs.

> Maybe if I constantly check fo existance of some django system process?

That would be the simpler and more fool-proof solution. Use cron if you can 
live with 1-minute resolution, otherwise use one of the many available service 
monitoring tools to check if your WSGI server is running and call 
turn_the_light_off() if not.

Erik

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/E4E88B42-1817-4B11-BAFC-C5D44A08061E%40cederstrand.dk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to