linux - shell-init: error retrieving current directory: getcwd -- The usual fixes do not wor -


i have simple script:

#!/bin/bash server in $(~/.ansible/ansible_hosts)     ssh $server "hostname; readlink /opt/mydir/mylink;" done 

it works fine - program returns correct hostname , link - except following error on not of servers:

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

all directories exist. 1 of common suggestions has been add cd, cd -, or cd /. happens when step added additional:

chdir: error retrieving current directory: getcwd: cannot access parent directories: no such file or directory

i tried kickstarting nfs daemon on off chance there confusion homedir , substituted /etc/init.d in case problem /opt. no difference

this annoyance except when try use ansible playbook instead of simple ssh command fails server.

any insights appreciated.

i believe error not related script @ all. issue is: directory @ when try run script not exist anymore. example have 2 terminals, cd somedir/ @ first 1 mv somedir/ somewhere_else/ @ second one, try run whatsoever in first terminal - you'll receive error message.

at least in case.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -