Re: pgkill for windows

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: pgkill for windows
Date: 2004-05-20 03:34:37
Message-ID: 200405200334.i4K3Yb027603@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


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/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

> #-------------------------------------------------------------------------
> #
> # 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.global
>
> override CPPFLAGS := -DPGBINDIR=\"$(bindir)\" -DPGDATADIR=\"$(datadir)\" -I$(libpq_srcdir) $(CPPFLAGS)
>
> OBJS= pgkill.o
>
> all: pgkill
>
> pgkill: $(OBJS)
> $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(at)$(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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-05-20 03:50:47 Re: [HACKERS] Configuration patch
Previous Message Bruce Momjian 2004-05-20 00:58:43 Re: Add error-checking to timestamp_recv