su: /bin/bsh Permission denied - Mailing list pgsql-admin

From 梁炳場
Subject su: /bin/bsh Permission denied
Date
Msg-id b03ca68b050724065958bdaabb@mail.gmail.com
Whole thread Raw
List pgsql-admin
The error message is
"su: /bin/bash Permission denied". The following is my startup script.
It is okay when it is run on command line.
It fails when it is called in /etc/init.d as Linux boots.

What do I need to do?
Thanks



#! /bin/sh
# PostgreSQL startup/shutdown script
#
#
case "$1" in
  start)
    pid=`pgrep postmaster`
    if [ -n "$pid" ]
    then
      echo "PostgreSQL is already running\n"
    else
      rm -f /tmp/.s.PGSQL.* > /dev/null
      echo "Starting PostgreSQL ..."
      su - postgres -c '/usr/local/pgsql/bin/pg_ctl start -D
/usr/local/pgsql/data -s -l /usr/local/pgsql/data/pg.log'
      sleep 1
      pid=`pgrep postmaster`
      if [ -n "$pid" ]
      then
         echo "PostgreSQL is running"
      else
         echo "PostgreSQL failed to start"
      fi
    fi
  ;;

  stop)
   echo "Stopping PostgreSQL ..."
   su - postgres -c '/usr/local/pgsql/bin/pg_ctl stop -D /usr/local/pgsql/data'
   sleep 2
   pid=`pgrep 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

pgsql-admin by date:

Previous
From: "Fabio C. Bon"
Date:
Subject: RE: [ADMIN] Re: [ADMIN] Error: No se pudo localizar un registro de checkpoint valido ¿ Como soluciono ?
Next
From: Mark P Anderson
Date:
Subject: