博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ubuntu 服务restart失败
阅读量:7219 次
发布时间:2019-06-29

本文共 832 字,大约阅读时间需要 2 分钟。

在ubuntu使用时碰到的一个问题,修改了nginx服务的配置文件后,重启服务,显示

* Restarting nginx nginx                                                [fail]

检查一下配置文件,没有问题,还原配置文件到修改前的状态,再次执行服务重启命令,依然报错,

按nginx的指导  使用nginx -t  查看错误原因

yumu_tech@yumutech009:~/nginx/conf/conf.d$ nginx -t

nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:2
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: [emerg] open() "/run/nginx.pid" failed (13: Permission denied)
nginx: configuration file /etc/nginx/nginx.conf test failed

错误说明 13: Permission denied

改用sudo 执行命令  sudo service nginx restart

 * Restarting nginx nginx                                                [ OK ]

问题总结

遇到 Permission denied  提示的改为root用户操作或者使用sudo命令操作基本可以解决问题,总结一下就是遇到操作失败时,首先看错误日志,

如遇到13: Permission denied的提示,表示权限不够,使用sudo 执行或换到root用户下操作,即可成功操作

转载于:https://www.cnblogs.com/dcybook/p/8243634.html

你可能感兴趣的文章
计算机运行命令全集
查看>>
WebSocket 实战
查看>>
二次排序
查看>>
CSS:如何清除a标签之间的默认留白间距
查看>>
selenium随笔
查看>>
leetcode599
查看>>
String类中“==”和“equals()”的区别
查看>>
leetcode--883
查看>>
the application could not be verified
查看>>
[转]Centos配置国内yum源
查看>>
redis数据类型和应用场景
查看>>
Spring IOC
查看>>
Fragment的onCreateView和onActivityCreate之间的区别(转)
查看>>
AC日记——统计难题 hdu 1251
查看>>
在仿真器中运行时跳过Windows Azure Startup任务
查看>>
android 获取路径目录方法以及判断目录是否存在,创建目录
查看>>
数列问题[HAOI2004模拟]
查看>>
2012各大IT公司校招笔试题整理
查看>>
phpcms 后台分页
查看>>
《需求工程》阅读笔记之六
查看>>