Sunday, April 11, 2010

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

Hey Guys,

If you facing issue " shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory " for restarting service whaterver mysql,httpd,etc,

just do "cd or cd / " on console

it will resolved.

[root@domU-taging]# /etc/init.d/mysqld restart
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Stopping MySQL: [ OK ]
Starting MySQL: [ OK ]

[root@domU-taging]# cd

[root@domU- ~]# /etc/init.d/mysqld restart
Stopping MySQL: [ OK ]
Starting MySQL: [ OK ]

cool.;)

13 comments:

Anonymous said...

Ih helped me. Thank you.

Matt said...

Wow, I can't believe that worked so easily. I still don't understand, but I'm glad it's working!

Anonymous said...

Often times, this is because your "current working directory," or the last directory you changed into, is no longer available. Perhaps the directory was removed or the disk it's located on was removed.

Anonymous said...

Same as Matt said. Strange that it works, but thank you!

Anonymous said...

i cannot believe it actually worked!
thank you!!!!

Anonymous said...

Thanks so much! You saved my day...

John Edward said...

thanks

berli888 said...

Thanks ! You explained how to solve this problem but you didn't explain the reason of the error.

Anonymous said...

You were in a location that was moved after you moved to that directory.

Laurel Mitro said...

Thank you! This worked perfectly!

acastano said...

Hi,

I have had the same thing. Find below the commands that provoke this message to me:

1.- user@pc:~ cd /home/user/Documents
2.- user@pc:/home/user/Documents/$ rm -Rf ../Documents
3.- user@pc:/home/user/Documents/$ su

So root tries to open a terminal on a location that has been removed.

That is all!!

Anonymous said...

Thank you so much!

Anonymous said...

Thanks! Helped me out!