From: | 梁炳場 <pc(dot)leung(at)gmail(dot)com> |
---|---|
To: | pgsql-admin(at)postgresql(dot)org |
Subject: | su: /bin/bsh Permission denied |
Date: | 2005-07-24 13:58:45 |
Message-ID: | b03ca68b050724065958bdaabb@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Mark P Anderson | 2005-07-24 15:35:51 | |
Previous Message | Eric Comeau | 2005-07-22 13:41:00 | Corrupt table, is zero_damaged_pages available in v7.2? |