pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Mack <mack@ifis.cs.tu-bs.de>
To: 'pgsql-admin@postgresql.org' <pgsql-admin@postgresql.org>
Subject: Re: Start-up script for Solaris
Date: Tue, 8 Aug 2006 13:53:57 +0200
Message-ID: <200608081353.57676.mack@ifis.cs.tu-bs.de> (raw)
In-Reply-To: <9765373733A7DF4681B12225D2FC44058E2D08@bosexprod001.bostonstock.local>
References: <9765373733A7DF4681B12225D2FC44058E2D08@bosexprod001.bostonstock.local>

Am Dienstag, 8. August 2006 13:27 schrieb mcelroy, tim:
> Good morning,
>
> Curious if anyone out there has a start-up script for Solaris?  A
> version of the Linux /etc/init.d/postgresql one.  I recently installed
> postgres on a Solaris 9 box and although I can start up postgres it
> fails to log to the log file as directed and just "doesn't look right",
> like it does on Linux.
>
I have a rather old one, which originally started and stopped a 6.5.2
postgres on Solaris 5.6 . Now it does its job on 7.4 and Solaris 10.

Thomas Mack

=====================================================================
#!/bin/sh

killproc() {            # kill the named process(es)
        pid=`/usr/bin/ps -e -o pid,args | \
             /usr/bin/grep "$1\>" | \
             /usr/bin/grep -v "$0\>" | \
             /usr/bin/grep -v grep | \
             /usr/bin/awk '{print $1}'`
        [ "$pid" != "" ] && kill -s INT $pid
        [ "$pid" != "" ] && sleep 2
        [ "$pid" != "" ] && kill -s QUIT $pid
}

#
# Start/stop postgres
#

case "$1" in

'start')
        echo "Starting postgres74..."
        killproc postmaster
        /usr/bin/rm -f /usr/local/pgsql/data/postmaster.pid
        su - postgres -c "source /usr/local/pgsql/.tcshrc; limit descriptors 512; cd /usr/local/pgsql/bin; ./postmaster -i -p 6007 -o -e >>& server.log&"
        ;;

'stop')
        killproc postmaster                     # kill postmaster process
        /usr/bin/rm -f /tmp/.s.PGSQL.6007
        ;;

'restart')
        $0 stop
        sleep 1
        $0 start
        ;;

*)
        echo "Usage: /etc/init.d/postgres74 { start | stop | restart }"
        ;;
esac





view thread (5+ messages)  latest in thread

Message-ID: <200608081353.57676.mack@ifis.cs.tu-bs.de>
Permalink:  ../200608081353.57676.mack@ifis.cs.tu-bs.de/
Also on:    postgresql.org/message-id/200608081353.57676.mack@ifis.cs.tu-bs.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: mack@ifis.cs.tu-bs.de
  Subject: Re: Start-up script for Solaris
  In-Reply-To: <200608081353.57676.mack@ifis.cs.tu-bs.de>
  References: <9765373733A7DF4681B12225D2FC44058E2D08@bosexprod001.bostonstock.local> <200608081353.57676.mack@ifis.cs.tu-bs.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox