pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Files ...
2+ messages / 2 participants
[nested] [flat]

* Files ...
@ 1999-08-26 16:43  Dmitry Samersoff <dms@wplus.net>
  0 siblings, 1 reply; 2+ messages in thread

From: Dmitry Samersoff @ 1999-08-26 16:43 UTC (permalink / raw)
  To: pgsql-hackers

This is three files IMHO useful for community

1. SysV start script for postgres, also can be used under freebsd
  (see below)
2. simple utility su_postgres, it make su to user postgres whether or not
   shell for it specified, is better than su for security reason   
3. configure/configure.in  checking for ps style 
   BSD  ps -ax or SysV  ps -e


Probably, there is the reason to include it (after some improvement0 into
distribution.



---
Dmitry Samersoff, dms@wplus.net, ICQ:3161705
http://devnull.wplus.net
* There will come soft rains ...

============================================================================
#ident  "@(#)/etc/init.d/pgsql 1.0 26/08/99 dms"

PG_HOME="/usr/local/pgsql"
PG_DATA="$PG_HOME/data"
UDS="/tmp/.s.PGSQL.5432"

PS="@PS@"
GREP="@GREP@"

case "$1" in
'start')
        # If no postgres run, remove UDS and start postgres.
        pid=
        set -- `$PS | $GREP postmaster | $GREP -v grep`
        [ $? -eq 0 ] && pid=$1

        if [ -z "$pid" ]; then
                rm -f "$UDS"
                $PG_HOME/bin/su_postgres "$PG_HOME/bin/postmaster -D $PG_DATA
-b $PG_HOME/bin/postgres -i -S -o -F &"
                echo "Postgres started"
        else
          echo "Postmaster already run with pid $pid"
        fi
        ;;
'stop')
        pid=
        set -- `$PS | $GREP postmaster | $GREP -v grep`
        [ $? -eq 0 ] && pid=$1

        if [ -z "$pid" ]; then
         echo "Postgres not run"
        else
         echo "Stoping postmaster with pid $pid" 
         kill $pid
        fi

        ;;
*)
        echo "USAGE: $0 {start | stop}"
        ;;
esac

Attachments:

  [application/octet-stream] pg_run.tar.gz (9.2K, ../../XFMail.990826204314.dms@wplus.net/2-pg_run.tar.gz)
  download

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [HACKERS] Files ...
@ 1999-09-27 19:41  Bruce Momjian <maillist@candle.pha.pa.us>
  parent: Dmitry Samersoff <dms@wplus.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Bruce Momjian @ 1999-09-27 19:41 UTC (permalink / raw)
  To: Dmitry Samersoff <dms@wplus.net>; +Cc: pgsql-hackers

These look awful custom to me.  Not sure how to integrate them.


[Charset KOI8-R unsupported, filtering to ASCII...]
> This is three files IMHO useful for community
> 
> 1. SysV start script for postgres, also can be used under freebsd
>   (see below)
> 2. simple utility su_postgres, it make su to user postgres whether or not
>    shell for it specified, is better than su for security reason   
> 3. configure/configure.in  checking for ps style 
>    BSD  ps -ax or SysV  ps -e
> 
> 
> Probably, there is the reason to include it (after some improvement0 into
> distribution.
> 
> 
> 
> ---
> Dmitry Samersoff, dms@wplus.net, ICQ:3161705
> http://devnull.wplus.net
> * There will come soft rains ...
> 
> ============================================================================
> #ident  "@(#)/etc/init.d/pgsql 1.0 26/08/99 dms"
> 
> PG_HOME="/usr/local/pgsql"
> PG_DATA="$PG_HOME/data"
> UDS="/tmp/.s.PGSQL.5432"
> 
> PS="@PS@"
> GREP="@GREP@"
> 
> case "$1" in
> 'start')
>         # If no postgres run, remove UDS and start postgres.
>         pid=
>         set -- `$PS | $GREP postmaster | $GREP -v grep`
>         [ $? -eq 0 ] && pid=$1
> 
>         if [ -z "$pid" ]; then
>                 rm -f "$UDS"
>                 $PG_HOME/bin/su_postgres "$PG_HOME/bin/postmaster -D $PG_DATA
> -b $PG_HOME/bin/postgres -i -S -o -F &"
>                 echo "Postgres started"
>         else
>           echo "Postmaster already run with pid $pid"
>         fi
>         ;;
> 'stop')
>         pid=
>         set -- `$PS | $GREP postmaster | $GREP -v grep`
>         [ $? -eq 0 ] && pid=$1
> 
>         if [ -z "$pid" ]; then
>          echo "Postgres not run"
>         else
>          echo "Stoping postmaster with pid $pid" 
>          kill $pid
>         fi
> 
>         ;;
> *)
>         echo "USAGE: $0 {start | stop}"
>         ;;
> esac
> 
> 
Content-Description: pg_run.tar.gz

[Attachment, skipping...]


-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1999-09-27 19:41 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-08-26 16:43 Files ... Dmitry Samersoff <dms@wplus.net>
1999-09-27 19:41 ` Bruce Momjian <maillist@candle.pha.pa.us>

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