Skip site navigation (1) Skip section navigation (2)

Re: Where is the link to cygwin?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Reini Urban <rurban(at)x-ray(dot)at>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>,Marek Lewczuk <newsy(at)lewczuk(dot)com>, pgsql-cygwin(at)postgresql(dot)org
Subject: Re: Where is the link to cygwin?
Date: 2004-11-01 03:59:34
Message-ID: 200411010359.iA13xYI02697@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-cygwinpgsql-patches
We just added code to add the *.exe suffix for MinGW and I am hoping
this will fix your register problem on Cygwin too.  Would you test a
recent snapshot and let me know if it works?

---------------------------------------------------------------------------

Reini Urban wrote:
> Marek Lewczuk schrieb:
> > Reini Urban wrote:
> >> Richard Sydney-Smith schrieb:
> >> A new initd script will come with 8.0,
> >> which just calls pg_ctl and
> >> adds service install/uninstall args.
> > 
> > Reini,
> > a few days ago you wrote that you are working on plperl patch for cygwin 
> > - how are doing with this ? 
> 
> well, bruce said that it should work now.
> I got reproducable crashes with IPC.
> But I really think that are problems with our cygserver,
> not with postgresql. That's why I'm busy with testing our cygserver,
> and a few libtool bugs.
> 
> > I also found a bug in "pg_ctl register" 
> > function - it adds a service, but the path to the pg_ctl file is 
> > /usr/local/pgsl/bin/pg_ctl.exe  - which is not available in windows.... 
> > or "pg_ctl register" will not work on cygwin ?
> 
> Ah, thanks Marek!
> 
> $ psservice config PostgreSQL
> 
> PsService v1.01 - local and remote services viewer/controller
> Copyright (C) 2001 Mark Russinovich
> Sysinternals - www.sysinternals.com
> 
> SERVICE_NAME: PostgreSQL
> (null)
>          TYPE              : 10 WIN32_OWN_PROCESS
>          START_TYPE        : 2  AUTO_START
>          ERROR_CONTROL     : 1  NORMAL
>          BINARY_PATH_NAME  : 
> /usr/src/postgresql/postgresql-8.0.0cvs/.inst/usr/sbin/./pg_ctl.exe
> runservice -N "PostgreSQL" -D "/usr/share/postgresql/data"
>          LOAD_ORDER_GROUP  :
>          TAG               : 0
>          DISPLAY_NAME      : PostgreSQL
>          DEPENDENCIES      : RPCSS
>          SERVICE_START_NAME: LocalSystem
> 
> We need another patch to pg_ctl to convert the exe path.
> 
> cd /usr/src/postgresql/postgresql-8.0.0cvs/src/bin/pg_ctl
> patch -p0 < cyg-ctlpaths.patch
> make
> cp ./pg_ctl.exe /usr/src/postgresql/postgresql-8.0.0cvs/.inst/usr/sbin
> 
> $ ./pg_ctl.exe unregister
> 
> rurban(at)reini /usr/src/postgresql/postgresql-8.0.0cvs/.inst/usr/sbin
> $ ./pg_ctl.exe register
> 
> rurban(at)reini /usr/src/postgresql/postgresql-8.0.0cvs/.inst/usr/sbin
> $ psservice config PostgreSQL
> 
> PsService v1.01 - local and remote services viewer/controller
> Copyright (C) 2001 Mark Russinovich
> Sysinternals - www.sysinternals.com
> 
> SERVICE_NAME: PostgreSQL
> (null)
>          TYPE              : 10 WIN32_OWN_PROCESS
>          START_TYPE        : 2  AUTO_START
>          ERROR_CONTROL     : 1  NORMAL
>          BINARY_PATH_NAME  : 
> f:\prog\gnu\cygwin\postgresql\postgresql-8.0.0cvs\.inst\usr\sbin\pg_ctl.
> exe runservice -N "PostgreSQL" -D "/usr/share/postgresql/data"
>          LOAD_ORDER_GROUP  :
>          TAG               : 0
>          DISPLAY_NAME      : PostgreSQL
>          DEPENDENCIES      : RPCSS
>          SERVICE_START_NAME: LocalSystem
> 
> -- 
> Reini Urban
> http://xarch.tu-graz.ac.at/home/rurban/

> Index: pg_ctl.c
> ===================================================================
> RCS file: /projects/cvsroot/pgsql/src/bin/pg_ctl/pg_ctl.c,v
> retrieving revision 1.39
> diff -u -b -c -r1.39 pg_ctl.c
> *** pg_ctl.c	16 Oct 2004 03:10:14 -0000	1.39
> --- pg_ctl.c	20 Oct 2004 01:02:56 -0000
> ***************
> *** 22,27 ****
> --- 22,28 ----
>   #include "getopt_long.h"
>   
>   #if defined(__CYGWIN__)
> + #include <sys/cygwin.h>
>   #include <windows.h>
>   #endif
>   
> ***************
> *** 814,819 ****
> --- 815,823 ----
>   {
>   	static char cmdLine[MAXPGPATH];
>   	int			ret;
> + #ifdef __CYGWIN__
> + 	static char buf[MAXPGPATH];
> + #endif
>   	
>   	if (registration)
>   		ret = find_my_exec(argv0, cmdLine);
> ***************
> *** 824,829 ****
> --- 828,838 ----
>   		write_stderr(_("%s: could not find exe"), progname);
>   		exit(1);
>   	}
> + #ifdef __CYGWIN__
> + 	/* need to convert to windows path */
> + 	cygwin_conv_to_full_win32_path (cmdLine, buf);
> + 	strcpy(cmdLine, buf);
> + #endif
>   
>   	if (registration)
>   	{
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
>                http://archives.postgresql.org

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

pgsql-cygwin by date

Next:From: Autosoft SystemsDate: 2004-11-01 13:19:14
Subject: Error In PostgreSQL Server Starting
Previous:From: Reini UrbanDate: 2004-10-29 19:04:41
Subject: Re: instructions are useful, but lacking

pgsql-patches by date

Next:From: Bruce MomjianDate: 2004-11-01 03:59:55
Subject: Re: fix for Makefile.shlib multiply defined target
Previous:From: Gaetano MendolaDate: 2004-11-01 01:11:45
Subject: Re: [PATCHES] [HACKERS] ARC Memory Usage analysis

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group