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

Running postgres as a "service" under w32 (9x/NT/2k)

From: "S(dot)L(dot)" <s0lao(at)netscape(dot)net>
To: pgsql-ports(at)postgresql(dot)org
Subject: Running postgres as a "service" under w32 (9x/NT/2k)
Date: 2000-11-20 16:30:16
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-ports
Here's a trick I use to start various unix "daemons" (apache, sshd) under
windows, without starting a cygwin console, or keeping one activated while 
the program is running (actually, for postgres, I use a php script to start
from apache, but it would work 100%).

I've written some "wrappers" for executables of the daemons, simple shell
scripts that (most important) defines the actual PATH needed for the program
in the second line, after #!/bin/sh line. After that I wrote the command line
with complete options for the program to be launched.
I'm starting a cygwish80 graphical console where I execute a command like
"exec c:\cygwin\bin\bash /<full_cygwin_name_of_the_script>". Closing tbe
cygwish window the launched app remains in background. It is not listed in
Services Control Panel on NT or W2k, can be stopped from task manager.

Here's an example with what I use to start sshd:


export PATH=/bin:/usr/bin:/usr/local/bin:.:~/


to start it as a background I'm starting a cygwish console and do an "exec
c:\cygwin\bin\bash /usr/users/administrator/sshd" and an "exit".

It's easy to make a shortcut for this, if you put the "exec [...]" line in a
start-sshd.tcl file which would be executed by cygwish.



Get your own FREE, personal Netscape WebMail account today at

pgsql-ports by date

Next:From: Jason TishlerDate: 2000-11-20 19:04:11
Subject: Building PostgreSQL 7.0.3 on Cygwin 1.1.5
Previous:From: Jason TishlerDate: 2000-11-19 02:53:48
Subject: Re: PostgreSQL for NT

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