X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id ADC0152A9E for ; Sun, 24 Jul 2005 10:59:13 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 78645-08 for ; Sun, 24 Jul 2005 13:59:09 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.203]) by svr1.postgresql.org (Postfix) with ESMTP id EAE2752A89 for ; Sun, 24 Jul 2005 10:59:08 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id 36so829030wra for ; Sun, 24 Jul 2005 06:59:10 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=jfrJfVN5pIq23GrjbHCxvdTl2SWU4W32Cih5LOJ6m40lSHMdWaH+rUaaQQNNMuNPUjMvRAUuf5bcJBQkMd3gZreBQDEV6OWaJxVN8k6wt7++hdZW7NHre+5iiLqrTVWf3Un25qFrQGAFr1HN70K9Bof4Lz4GFvFwxmMyryRmUfY= Received: by 10.54.4.60 with SMTP id 60mr372519wrd; Sun, 24 Jul 2005 06:59:10 -0700 (PDT) Received: by 10.54.97.16 with HTTP; Sun, 24 Jul 2005 06:58:45 -0700 (PDT) Message-ID: Date: Sun, 24 Jul 2005 21:58:45 +0800 From: =?ISO-2022-JP?B?GyRCTkJfWz5sGyhC?= Reply-To: =?ISO-2022-JP?B?GyRCTkJfWz5sGyhC?= To: pgsql-admin@postgresql.org Subject: su: /bin/bsh Permission denied Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.024 tagged_above=0 required=5 tests=RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200507/184 X-Sequence-Number: 18240 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=3D`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=3D`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/d= ata' sleep 2 pid=3D`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