Project

General

Profile

« Previous | Next » 

Revision 874cf06a

Added by Nathan Scott over 15 years ago

  • ID 874cf06a6f513c8232fe43cc7f14d489ce67bc50

Support tools for sending "signals" to PCP tools on Windows.

Windows has minialistic support for the notion of (POSIX) signals.
This is a major problem for PCP, where asynchronous notification
drives many critical pieces of functionality in various tools...

  • orderly shutdown of many tools is expected when SIGTERM is sent, especially daemons being controlled by the rc scripts.
  • (non-default) agent installation process requires pmcd to reread its config file (via SIGHUP), namespace, etc.
  • pmlogger flushing is done by SIGUSR, log volume rotation is done via SIGHUP.
  • pmie log files are rotated via SIGHUP.
  • etc, etc.

This commit provides a new win32 tool "pcp-setevent", and new kill
equivalent for PCP tools ("pmsignal") - which works for all of the
supported platforms, and implements the killall functionality also.

Any scripts (or administrator actions) that need to send what would
traditionally have been a signal (i.e. kill/killall) should use the
new pmsignal tool. On *NIX systems, this is a kill(1) wrapper. On
win32, it uses pcp-setevent.

The Win32 implementation uses Event objects in a PCP//
namespace to facilitate delivery of "signals" (events). Only the
HUP, USR, and TERM signals will be supported. All tools will allow
TERM to be sent, and will do atexit(2) cleanup in this case. pmcd
and other daemons will be able to register HUP and USR handlers as
well, which pmsignal will be able to notify. The implementation of
KILL is a special case, which is implemented by a direct Win32 API
call to TerminateProcess (not "catchable").

So, in future, we should not be open-coding the use of kill(1) and
killall(1) in any shell scripts (PCP_KILLALL_PROG will soon go the
way of the dodo) - pmsignal should always be used, in both cases.
A man page is in the works to document pmsignal more completely,
but the above pretty much covers it from a technical POV. On *NIX
systems administrators can obviously continue to use kill/killall,
but all the Cool Kids will be using pmsignal.

  • added
  • modified
  • copied
  • renamed
  • deleted