This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Intercepting shutdown messges
- From: José Alburquerque <jaalburquerque at cox dot net>
- To: libc-help at sourceware dot org
- Date: Wed, 13 Aug 2008 16:23:03 -0400
- Subject: Intercepting shutdown messges
Hello. This is my first post to this list and I simply have a general
question about pseudo terminals which I'm hoping can be answered on this
list! As weird as it may sound, I'm trying to write a simple program
(in C naturally) to sort of "intercept" shutdown messages when they are
sent to terminals (I notice that all my open terminals receive a "The
system is going down in XXX minutes" when shutdown is running). To this
end, I wrote a simple program that uses opentty() to open a master/slave
pseudo terminal pair. I can read and print data sent to the /dev/pts/*
file sent to the slave using the master file descriptor, but I'm sort of
stuck because when shutdown runs, my program doesn't read the shutdown
messages. Anyone have any suggestions as to what I need to add to
"intercept" these shutdown messages? Am I going about this the wrong
way? Thanks for any help.
--
José Alburquerque