root.shの実行

oracle製品をインストールするときにハマったのでメモ。
root.sh実行時はrootディレクトリにいるとエラーになる。
(gridユーザの書き込み権限があるディレクトリでスクリプトを実行する必要がある)

下記のようなエラーが表示される。

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
pwd: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
Run root.sh from a directory that has read/execute access to the grid owner 'grid'
/opt/app/11.2.0.4/grid/perl/bin/perl -I/opt/app/11.2.0.4/grid/perl/lib -I/opt/app/11.2.0.4/grid/crs/install /opt/app/11.2.0.4/grid/crs/install/rootcrs.pl execution failed

カレントディレクトリを移動して実行すれば解決。

root@node1:~# cd /opt/app/11.2.0.4/grid/
root@node1:/opt/app/11.2.0.4/grid# pwd
/opt/app/11.2.0.4/grid
root@node1:/opt/app/11.2.0.4/grid# sh root.sh