problems_centos

problems_centos

1 CentOS虚拟机断电或强制关机,再开机出现问题

errorlog: Entering emergency mode. Exit the shell to continue

RCA:
找出问题出现在哪:
这里的 journalctl 是查看系统的日志信息;直接输入此命令查看,日志内容可能很多,快速翻页或者直接定位到最新的日志信息,发现有标红的,说明此处出现错误。

failed to mount /sysroot.
在我的电脑上,/sysroot 映射到了 /dev/mapper/centos-root,其他人的可能不同

solution:
xfs_repair -v -L /dev/mapper/centos-root # -L 选项指定强制日志清零,强制xfs_repair将日志归零,即使它包含脏数据(元数据更改)
然后reboot
reference: https://blog.csdn.net/qq_41610418/article/details/81704362

2 centos中安装php5.6.27报错

php5.6.27编译(make && make install)报错,且无法解决。报错内容如下:

/usr/develop/php-5.6.27/ext/openssl/openssl.c:3485:14: error: dereferencing pointer to incomplete type 'EVP_PKEY' {aka 'struct evp_pkey_st'}
  switch (pkey->type) {
              ^~
/usr/develop/php-5.6.27/ext/openssl/openssl.c: In function 'php_openssl_pkey_init_dsa':
/usr/develop/php-5.6.27/ext/openssl/openssl.c:3557:10: error: dereferencing pointer to incomplete type 'DSA' {aka 'struct dsa_st'}
  if (!dsa->p || !dsa->q || !dsa->g) {
          ^~
/usr/develop/php-5.6.27/ext/openssl/openssl.c: In function 'php_openssl_pkey_init_dh':
/usr/develop/php-5.6.27/ext/openssl/openssl.c:3580:9: error: dereferencing pointer to incomplete type 'DH' {aka 'struct dh_st'}

原因:php5.6.27和openssl1.1.1c不兼容。

我查看了我的openssl版本是:

[root@node3 php-5.6.27]# openssl version
OpenSSL 1.1.1c FIPS  28 May 2019

初步解决方法:把openssl的版本降级,我选择的是openssl-1.0.0c。重新编译安装,就不会有编译错误了。

yum remove -y openssl
cd /usr/apps/
wget -c ftp://ftp.openssl.org/source/openssl-1.0.0c.tar.gz
tar -zxf openssl-1.0.0c.tar.gz
cd openssl-1.0.0c/
./config  --prefix=/usr/local --openssldir=/usr/local/ssl
make && make install
./config shared --prefix=/usr/local --openssldir=/usr/local/ssl
make clean 
make && make install
openssl version # 查看版本

发现没用,总是有各种各样的问题。
最终解决方法:安装php7.3.13。
安装参考链接

3 CentOS7.7定时任务不生效

设置定时任务:
设置:crontab -e
* * * * * root /usr/local/bin/haloBak
查看:crontab -l ,发现里面有这条定时任务了。

但是发现任务不执行,
于是重启crontab: systemctl restart crond.service
还是不行;
重启电脑,还是不行;
然后, vim /etc/crontab,发现crontab文件中没有该条任务,于是手动在里面添加这条任务,还是不行;
期间老是收到邮件,于是进入邮件查看内容:tail -50f /var/spool/mail/root
关键内容: /bin/sh: root: command not found
网上查资料,说设置任务时,不用添加用户名root,于是重新crontab -e , 并修改任务为: * * * * * /usr/local/bin/haloBak
成功!

4

5

6

posted @ 2021-08-16 21:32  mediocrep  阅读(199)  评论(0编辑  收藏  举报
既然选择了远方,便只顾风雨兼程!