shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

Today I saw an interesting error ,while restarting apache
=======
]# /etc/init.d/httpd restart
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Stopping httpd: [ OK ]
Starting httpd: shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
[ OK ]
]#
===========
may be you also face this or already faced.
Don’t surprise …Just do a  ” cd  / ”   , or  cd  to any direcotry ..  it will fix the error !!   😉

Why this error ?
Usually the current working directory ( CWD ) will not exists ( in my case i have deleted the folder from another shell and trying to restart apache )

  • Chu Quang Tú

    Thanks you ! It helped me

  • lijinma

    Thanks a lot!

  • haile

    very greate. thanks a lot!!

  • Om Prakash

    Also we can add “export `pwd’ ” in .profile file

    It worked for me.

  • Thank you all for the comments and reading my blog

  • vikash gupta

    I am a new bee to shell scripts…. It helped me a lot… thank you..