systemctl查看完整非截断日志显示详细信息详细日志用systemctl status slapd.service -l,启动nginx时出现:Starting nginx (via systemctl): Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.

jackxiang 2015-10-10 14:41 | |
Hint: Some lines were ellipsized, use -l to show in full. systemctl status slapd  -l ,'journalctl -xn' for details. 看不清换行,先journalctl -xn > out.log,再vim看。
一)那个Service XXX start时,也是装入了内存活它的Service系统的,而用chkconfig -add memcached  就是装入这个Service系统,完全类似centos7 的systemctl daemon-reload,也就是说你改了/etc/init.d/memcached  如果不chkconfig -add memcached,service memcached start执行的还是旧的(尽管你替换了那个/etc/init.d/memcached文件), 同理/lib/systemd/system/memcached.service,也是一样的道理,修改后得 systemctl daemon-reload才会生效,直接运行systemctl start memcached会提示你systemctl daemon-reload,不让你运行,也就是说它会监控/etc/systemd/system/*.service外,发现它还会监控centos6的/etc/init.d/* 的修改。
二)在CentOS7里面,只有运行了service memcached start后,这个systemctl才行被注入,一上来就运行systemctl start memcached , 它是不认识这个memcached  的,再就是如果自己Kill掉,没有用 service memcached stop,这个sytemctl 也是不知道它关了,想用systemctl start memcached也无法启动的,因为systemctl 认为它还运行着呢,于是得用systemctl stop memcached 后,再运行systemctl start memcached,也就成功了,否则即使systemctl start memcached啥也不输出就退出了,但是那个进程还是没有启动,说白了,在CentOS7里面,那个启动和停止最好是经过service或systemctl,连service 也是被systemctl接管了的,都得向systemctl注册!!!,艹。


背景:conf里面有一个ssl的conf,scp过来抄时忘记删除,但nginx下的nginx.conf下是include *.conf,于是出问题了,但nginx不报这个conf有问题,而是说没有找到ssl的crt文件,怎么办?主要是学会看日志 cat /var/log/messages | grep nginx ,看日志才发现是多了一个conf文件。

service nginx reload
Reloading nginx configuration (via systemctl):  Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.
——————————————————————————————————————————————————————————————————————

启动apache服务出现,或启动nginx时出现:
Starting nginx (via systemctl): Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.
查看错误提示

主要是学会看日志 cat /var/log/messages | grep nginx
Oct 10 14:34:12 iZ251vfc84kZ nginx: nginx: [emerg] BIO_new_file("/usr/local/nginx/conf/ssl/svn.justwinit.crt") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/usr/local/nginx/conf/ssl/svn.justwinit.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
Oct 10 14:34:12 iZ251vfc84kZ nginx: nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
Oct 10 14:34:12 iZ251vfc84kZ systemd: nginx.service: control process exited, code=exited status=1
[root@iZ251vfc84kZ vhost]# grep -r "svn.justwinit.crt" ./
./svn.justwinit.conf:        ssl_certificate     ssl/svn.justwinit.crt;
[root@iZ251vfc84kZ vhost]# rm -Rf svn.justwinit.conf


来自:http://wangsheng1.blog.51cto.com/29473/1550655

作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/8288/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!


最后编辑: jackxiang 编辑于2020-12-28 20:28
评论列表
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]