shell-init: error retrieving current directory

时间:2019-08-20 17:58:31  来源:igfitidea点击:

在启动squid服务时遇到这个报错。

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

函数getcwd()的作用是:将当前工作目录的绝对路径名复制到buf指向的数组中

解决方案:

将当前目录改为/,然后重新启动squid服务。

[root@localhost modules]# /etc/init.d/squid restart
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Stopping squid: ................                           [  OK  ]
Starting squid: .                                          [  OK  ]
[root@localhost modules]# cd /
[root@localhost /]# /etc/init.d/squid restart
Stopping squid: ................                           [  OK  ]
Starting squid: .                                          [  OK  ]
[root@localhost /]#