[Cialug] PostgreSQL on SUSE 10.1

Jerry Heiselman jweida at gmail.com
Mon Jul 31 08:40:30 CDT 2006


Here's a generic startup script for postgresql.  You'll have to modify
it for your paths, but it should work fine once you do.  Note, that
this script assumes your postgresql user is postgres, but that's
pretty standard.

#! /bin/sh
# PostgreSQL startup/shutdown script

case "$1" in
  start)
    pid=`pidof postmaster`
    if [ -n "$pid" ]
    then
      echo "PostgreSQL is already running\n"
    else
      rm -f /tmp/.s.PGSQL.* > /dev/null
      echo "Starting PostgreSQL ... from $POSTGRESQL_HOME"
      su -l postgres -c '$POSTGRESQL_HOME/bin/postmaster -i -S
-D$POSTGRESQL_HOME/data'
      sleep 1
      pid=`pidof postmaster`
      if [ -n "$pid" ]
      then
         echo "PostgreSQL is running"
      else
         echo "PostgreSQL failed to start"
      fi
    fi
  ;;

  stop)
   echo "Stopping PostgreSQL ..."
   killproc postmaster
   sleep 2
   pid=`pidof postmaster`
   if [ -n "$pid" ]
   then
      echo "PostgreSQL failed to stop"
   else
      echo "PostgreSQL is stopped"
   fi
  ;;

  status)
   status postmaster
  ;;

  restart)
   $0 stop
   $0 start
  ;;

  *)
    echo "Usage: postgresql {start|stop|status|restart}"
    exit 1
esac

exit 0



On 7/30/06, Carl Olsen <carl-olsen at mchsi.com> wrote:
> I've just installed SUSE Linux 10.1 and I've got PostgreSQL configured and
> accepting remote connections from my local network.  It doesn't seem to
> start automatically when the system reboots.  Does anyone know what I need
> to do to get it to start automatically?
>
> Carl Olsen
> http://www.carl-olsen.com/
>
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
>


More information about the Cialug mailing list