pgkill for windows
Attached are 2 files needed to create a pgkill facility for Windows, and
a complementary patch for src/bin/Makefile
It is adapted from the facility on the Win32 page, but uses the builtin
signal definitions rather than using its own.
This facility is needed for shutting down postgres cleanly as part of
'make check', as we don't really use signals in Windows, we only emulate
them using our own scheme, so any native kill program doesn't have the
desired effect.
cheers
andrew
Andrew Dunstan wrote:
Attached are 2 files needed to create a pgkill facility for Windows,
and a complementary patch for src/bin/Makefile
If it's only for the regression tests, then it should go into that
directory.
Andrew Dunstan wrote:
Attached are 2 files needed to create a pgkill facility for
Windows,
and a complementary patch for src/bin/Makefile
If it's only for the regression tests, then it should go into
that directory.
It is not. It is a tool required to do any "controlled backend
termination" on win32. The regression tests is just one user of it.
Regression tests is just one user of it.
(You can shutdown the postmaster using Ctrl-C or using the Service
Control Manager, but pgkill is required for individual backend
signalling).
//Magnus
Import Notes
Resolved by subject fallback
Peter Eisentraut wrote:
Andrew Dunstan wrote:
Attached are 2 files needed to create a pgkill facility for Windows,
and a complementary patch for src/bin/MakefileIf it's only for the regression tests, then it should go into that
directory.
In effect you need this on Windows anywhere that in Unix you would want
to use kill (1) on a postgres process.
cheers
andrew
Andrew Dunstan wrote:
Attached are 2 files needed to create a pgkill facility for Windows,
and a complementary patch for src/bin/MakefileIf it's only for the regression tests, then it should go into that
directory.In effect you need this on Windows anywhere that in Unix you would want
to use kill (1) on a postgres process.
Is this something that should be part of the Win32 pg_ctl C code
instead?
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
Attached are 2 files needed to create a pgkill facility
for Windows,
and a complementary patch for src/bin/Makefile
If it's only for the regression tests, then it should go into that
directory.In effect you need this on Windows anywhere that in Unix you would
want to use kill (1) on a postgres process.Is this something that should be part of the Win32 pg_ctl C
code instead?
I'd say also, not instead.
pg_ctl still only works on the postmaster.
//Magnus
Import Notes
Resolved by subject fallback
I was hoping to avoid platform-specific binaries. Once pg_ctl is done
in C, it can start/stop the postmaster, but not individual backends.
Can we add a flag to pg_ctl so it can send arbitrary signals to
processed on Win32? That would be best, I think.
---------------------------------------------------------------------------
Andrew Dunstan wrote:
Attached are 2 files needed to create a pgkill facility for Windows, and
a complementary patch for src/bin/MakefileIt is adapted from the facility on the Win32 page, but uses the builtin
signal definitions rather than using its own.This facility is needed for shutting down postgres cleanly as part of
'make check', as we don't really use signals in Windows, we only emulate
them using our own scheme, so any native kill program doesn't have the
desired effect.cheers
andrew
#-------------------------------------------------------------------------
#
# Makefile for src/bin/pgkill
#
# Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
# $PostgreSQL: pgsql-server/src/bin/pgkill/Makefile,v 1.36 2004/04/26 17:40:48 momjian Exp $
#
#-------------------------------------------------------------------------subdir = src/bin/pgkill
top_builddir = ../../..
include $(top_builddir)/src/Makefile.globaloverride CPPFLAGS := -DPGBINDIR=\"$(bindir)\" -DPGDATADIR=\"$(datadir)\" -I$(libpq_srcdir) $(CPPFLAGS)
OBJS= pgkill.o
all: pgkill
pgkill: $(OBJS)
$(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $@$(X)install: all installdirs
$(INSTALL_PROGRAM) pgkill$(X) $(DESTDIR)$(bindir)/pgkill$(X)installdirs:
$(mkinstalldirs) $(DESTDIR)$(bindir)uninstall:
rm -f $(DESTDIR)$(bindir)/pgkill$(X)clean distclean maintainer-clean:
rm -f pgkill$(X) $(OBJS)# ensure that changes in bindir etc. propagate into object file
pgkill.o: pgkill.c $(top_builddir)/src/Makefile.global
Index: src/bin/Makefile =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/bin/Makefile,v retrieving revision 1.43 diff -c -r1.43 Makefile *** src/bin/Makefile 20 Apr 2004 00:40:06 -0000 1.43 --- src/bin/Makefile 10 May 2004 16:17:52 -0000 *************** *** 15,20 **** --- 15,24 ----DIRS := initdb initlocation ipcclean pg_ctl pg_dump \ psql scripts pg_config pg_controldata pg_resetxlog + ifeq ($(host_os), mingw32) + DIRS := $(DIRS) pgkill + endif +all install installdirs uninstall depend distprep:
@for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
Bruce Momjian said:
I was hoping to avoid platform-specific binaries. Once pg_ctl is done
in C, it can start/stop the postmaster, but not individual backends.
Can we add a flag to pg_ctl so it can send arbitrary signals to
processed on Win32? That would be best, I think.
Ok, that makes sense.
I am working on pg_ctl and hope to have a first cut in a day or two
(everything is done except the startup code).
cheers
andrew