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

A few moments ago, while trying to restart the Postfix service on a client’s system, I was getting the following error:

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

Some strace runs later, I found that my pwd had been removed and recreated, so I was essentially in a state of limbo as far as the system was concerned. Quick fix:

cd && cd -

Brings me to my ~ directory, then back to the original pwd, and – most importantly – no more errors.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

The CAPTCHA cannot be displayed. This may be a configuration or server problem. You may not be able to continue. Please visit our status page for more information or to contact us.

This site uses Akismet to reduce spam. Learn how your comment data is processed.