pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: $BNB_[>l(B <pc.leung@gmail.com>
To: pgsql-admin@postgresql.org
Subject: su: /bin/bsh Permission denied
Date: Sun, 24 Jul 2005 21:58:45 +0800
Message-ID: <b03ca68b050724065958bdaabb@mail.gmail.com> (raw)

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



Message-ID: <b03ca68b050724065958bdaabb@mail.gmail.com>
Permalink:  ../b03ca68b050724065958bdaabb@mail.gmail.com/
Also on:    postgresql.org/message-id/b03ca68b050724065958bdaabb@mail.gmail.com

 · 

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: pc.leung@gmail.com
  Subject: Re: su: /bin/bsh Permission denied
  In-Reply-To: <b03ca68b050724065958bdaabb@mail.gmail.com>
  References: <b03ca68b050724065958bdaabb@mail.gmail.com>

* 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