nginx 重启报错处理

技术文档 - PHP文档 作者: xcheng1986 发布于:2014-07-14 阅读(2162) (暂无评论)  

[root@localhost Conf]# /root/lnmp restart
shell-init: error retrieving current directory: getcwd: cannot access parent directories: 没有那个文件或目录
=========================================================================
Manager for LNMP V1.0  ,  Written by Licess
=========================================================================
LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux
This script is a tool to Manage status of lnmp
For more information please visit http://www.lnmp.org

Usage: /root/lnmp {start|stop|reload|restart|kill|status}
=========================================================================
Stoping LNMP...
shell-init: error retrieving current directory: getcwd: cannot access parent directories: 没有那个文件或目录
Stoping nginx...  done
shell-init: error retrieving current directory: getcwd: cannot access parent directories: 没有那个文件或目录
Gracefully shutting down php-fpm . done
shell-init: error retrieving current directory: getcwd: cannot access parent directories: 没有那个文件或目录
Shutting down MySQL. SUCCESS!
Starting LNMP...
shell-init: error retrieving current directory: getcwd: cannot access parent directories: 没有那个文件或目录
Starting nginx...  done
shell-init: error retrieving current directory: getcwd: cannot access parent directories: 没有那个文件或目录
Starting php-fpm  done
shell-init: error retrieving current directory: getcwd: cannot access parent directories: 没有那个文件或目录
chdir: error retrieving current directory: getcwd: cannot access parent directories: 没有那个文件或目录
Starting MySQL.. SUCCESS!
[root@localhost Conf]#


该错误表示 getcwd 命令无法定位到当前工作目录。一般来说是因为你 cd 到了某个目录之后 rm 了这个目录
这时去执行某些 service 脚本的时候就会报 getcwd 错误。
只需要 cd 到任何一个实际存在的目录下在执行命令即可。
出现这种现象的原因还有,当前用户没有当前目录的可执行权限