昨天搬到阿里云了。

装的系统是Centos 6.3的加固版

今天查看内存的时候 出现一天奇怪的提示

You have new mail in /var/spool/mail/root

有的时候每敲一下回车,就出来You have new mail in /var/spool/mail/root的提示,究竟是为什么呢?

Linux 系统经常会自动发出一些邮件来提醒用户系统中出了哪些问题(收件箱位置:/var/mail/)。可是这些邮件都是发送给 root 用户的。出于系统安全考虑,通常不建议大家直接使用 root 帐户进行日常操作。所以要想点办法来让系统把发给 root 用户的邮件也给自己指定的外部邮箱发一份,或者是直接关闭此项服务。

1、关闭sendmail服务,这里介绍一种不用关闭sendmail服务的方法

 代码如下 复制代码

echo "unset MAILCHECK">> /etc/profile;

source /etc/profile

关闭sendmail的功能:

 代码如下 复制代码

chmod 0 /usr/sbin/sendmailmv /usr/sbin/sendmail /usr/sbin/sendmail.bakln -s /var/qmail/bin/sendmail /usr/sbin/sendmail

清空 /var/spool/mail/root日志

 代码如下 复制代码
cat /dev/null > /var/spool/mail/rootcat /dev/null>;/var/spool/mail/root

或者转发到自己的邮箱,下面介绍下怎么转发到自己的邮箱(此方法未经本人亲自验证 来源于网络,有喜欢折腾的请自己研究,成功了 可以跟帖分享经验)

2、root邮件转发到自己的邮箱
方法一:
修改此文件

 代码如下 复制代码
/etc/log.d/logwatch.conf
添加MailTo = root,xxx@xxx.com

方法二

 代码如下 复制代码
/etc/aliases

添加root: xxx@xxx.com

注意:好像如果设置成和主机同域的,好像邮件就发不成,比如本机邮件就是moper.me,那么发这个就没法发,相应的发其他邮箱就可以成功。

关于“/etc/aliases”:

当sendmail收到一个要送给xxx的信时,它会依据/etc/aliases文件中的内容送给另一个使用者。这个功能可以创造一个只有在信件 系统内才有效的使用者。例如mailing list就会用到这个功能,在 mailing list 中,我们可能会创造一个叫 redlinux@link.ece.uci.edu的 mailinglist,但实际上并没有一个叫redlinux的使用者。实际 aliases档的内容是将送给这个使用者的信都收给mailing list处理程式负责分送的工作。

/etc/aliases是一个文本文档,而sendmail需要一个二进位格式的 /etc/aliases.db。newaliases的功能传是将/etc/aliases转换成一个sendmail所能了解的db文件:

 代码如下 复制代码

[root@centos ~]# newaliases

除root外的其它用的邮件可以通过在用户/home/下建立一个.forward文件实现转发:

 代码如下 复制代码
//somebody
other1
other2

文件权限设为600,作用一样,但.forward可以由用户自行维护,而aliases则只有治理员才能修改。

设定~/.forward档案加入转寄目的即可

网上很多教程是你抄我,我抄你,根本就没有验证过的,比如有种方法是修改”/usr/share/logwatch/default.conf/logwatch.conf“配置文件,在centos6中根本就没有这个文件,至于以前的版本有没有就不知道了。

还有很多教程,只有“echo "unset MAILCHECK" >> /etc/profile”,而没有“source /etc/profile”,这也是不对的。

报错信息如下

Error: ossl_pkey_ec.c:In functin 'ossl_ec_group_initialize': ossl_pkey_ec.c:816:error: 'EC_GROUP_new_curve_GF2m' undeclard (first use in this function) ossl_pkey_ec.c:816:error: (Each undeclard indentifier is reported only once ossl_pkey_ec.c:816 error:for each function it appearts in.)

产生问题的原因是:centos6.4的openssl的配置变更取消了对EC_GROUP_new_curve_GF2m的支持,所以出现该错误.

报错的文件为:ossl_pkey_ec.c

用find命令找到ossl_pkey_ec.c文件路径

find / -name ossl_pkey_ec.c 
编辑文件ossl_pkey_ec.c,如下图所示,在相应位置添加红框内的代码即可

保存退出后,重新make

报错如下:

 代码如下 复制代码
Could not init font path element catalogue:/etc/X11/fontpath.d, removing from list!

其日志内容如下:

 代码如下 复制代码
 
[    22.264] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer
[    22.264] (II) AIGLX: enabled GLX_INTEL_swap_event
[    22.264] (II) AIGLX: enabled GLX_ARB_create_context
[    22.264] (II) AIGLX: enabled GLX_ARB_create_context_profile
[    22.264] (II) AIGLX: enabled GLX_EXT_create_context_es2_profile
[    22.264] (II) AIGLX: enabled GLX_SGI_swap_control and
GLX_MESA_swap_control
[    22.264] (II) AIGLX: GLX_EXT_texture_from_pixmap backed by buffer
objects www.111cn.net
[    22.264] (II) AIGLX: Loaded and initialized r600
[    22.264] (II) GLX: Initialized DRI2 GL provider for screen 0
[    22.269] (II) RADEON(0): Setting screen physical size to 846 x 238
[    22.269] [dix] Could not init font path element
catalogue:/etc/X11/fontpath.d, removing from list!
[    22.269] [dix] Could not init font path element built-ins, removing
from list!
[    22.269]
Fatal server error:
[    22.269] could not open default font 'fixed'
[    22.269] (EE)
Please consult the CentOS support
         at http://wiki.centos.org/Documentation
for help.
[    22.269] (EE) Please also check the log file at
"/var/log/Xorg.1.log" for additional information.
[    22.269] (EE)
[    22.269] (II) AIGLX: Suspending AIGLX clients for VT switch
[    22.276] Server terminated with error (1). Closing log file.

解决办法:

 代码如下 复制代码
yum install libXfont

解决Centos关闭You have new mail in /var/spool/mail/root提示的更多相关文章

  1. 解决Centos关闭You have new mail in /var/spool/mail/root提示(转)

    今天查看内存的时候 出现一天奇怪的提示 You have new mail in /var/spool/mail/root 有的时候每敲一下回车,就出来You have new mail in /va ...

  2. You have new mail in /var/spool/mail/root 解决烦琐提示的方法

    今天写定时任务时,出现奇怪的提示,有的时候每敲一下回车,也出现奇怪的提示 You have new mail in /var/spool/mail/root 阿西吧........表示很烦...究竟是 ...

  3. Linux出现You have new mail in /var/spool/mail/root提示,关闭邮件提示清理内容的解决方案

    Linux出现You have new mail in /var/spool/mail/root提示,关闭邮件提示的解决方案 有的时候敲一下回车,就出来You have new mail in /va ...

  4. Linux关闭You have new mail in /var/spool/mail/root提示

    终端远程登陆Linux后经常提示You have new mail in /var/spool/mail/root 这个提示是LINUX会定时查看LINUX各种状态做汇总,每经过一段时间会把汇总的信息 ...

  5. 禁止Centos系统You have new mail in /var/spool/mail/root提示

    禁止Centos系统You have new mail in /var/spool/mail/root提示 https://blog.csdn.net/oyym_mv/article/details/ ...

  6. 解决You have new mail in /var/spool/mail/root提示

    终端远程登陆后经常提示You have new mail in /var/spool/mail/root 这个提示是LINUX会定时查看LINUX各种状态做汇总,每经过一段时间会把汇总的信息发送的ro ...

  7. You have new mail in /var/spool/mail/root 烦不烦你(转)

    转自(http://blog.csdn.net/yx_l128125/article/details/7425182) 有时在进入系统的时候经常提示You have new mail in /var/ ...

  8. You have new mail in /var/spool/mail/root消除提示的方法

    有时在进入系统的时候经常提示You have new mail in /var/spool/mail/root 你觉得烦人---解决方法: 修改系统配置文件/etc/profile,告诉系统不要去检查 ...

  9. you have new mail in /var/spool/mail/root !

    今天开发的同事告诉我,他在登录系统时老是提示you have new mail in /var/spool/mail/root ! 我一猜就知道他们肯定又自己写定时任务了,这样的事已经发生过好几回了, ...

随机推荐

  1. 每天一个linux命令(39):iostat命令

    Linux系统中的 iostat 是I/O statistics(输入/输出统计)的缩写,iostat工具将对系统的磁盘操作活动进行监视.它的特点是汇报磁盘活动统计情况,同时也会 汇报出CPU使用情况 ...

  2. 思甜雅--关于qq的NABCD模型分析

    个人连接:http://www.cnblogs.com/xiaoliulang/ 关于QQ的NABCD模型 N--Need 随着电脑的普及,人们在网络上进行交流的时间越来越多,由于现有的交流工具还不是 ...

  3. Productivity Power Tools 动画演示--给力的插件工具

    免费的精品: Productivity Power Tools 动画演示 Productivity Power Tools 是微软官方推出的 Visual Studio 扩展,被用以提高开发人员生产率 ...

  4. VS中两个常用辅助工具

    一. 首当推荐的是DPack 下载地址:http://www.usysware.com/dpack/ 快捷键:以下都是个人常用的热键.其他还有,我都用得比较少了,3个已经完全够了 Alt+U   查找 ...

  5. Spring对Hibernate的session生效期(事物提交管理)介绍

    在Hibernate中我们每次进行一个操作的的时候我们都是要先开启事务,然后进行数据操作,然后提交事务,关闭事务,这样做的原因是因为Hibernate默认的事务自动提交是false,它是需要人为的手动 ...

  6. 设计模式原来如此-代理模式(Proxy Pattern)

    代理模式(Proxy Pattern)是一个使用率非常高的模式,其定义如下:为其他对象提供一种代理以控制对这个对象的访问. 在某些情况下,一个客户不想或者不能直接引用另一个对象,而代理对象可以在客户端 ...

  7. opencv笔记6:角点检测

    time:2015年10月09日 星期五 23时11分58秒 # opencv笔记6:角点检测 update:从角点检测,学习图像的特征,这是后续图像跟踪.图像匹配的基础. 角点检测是什么鬼?前面一篇 ...

  8. 解决:Angular-cli:执行ng-build --prod后,dist文件里无js文件、文件未压缩等问题

    Angular2.0于2016年9月上线,我于9月入坑. 入坑以来,一直让我很困惑的问题 1.angular-cli是个什么鬼东西? 2.为什么我们自己的资源文件还没写什么,就有起码50多个js文件加 ...

  9. 一个完整的编译器前端-A.1 源语言

    这个语言的一个程序由一个块组成,该块中包含可选的声明和语句.语法符号basic表示基本类型. program –> block block   –> { decls stmts } dec ...

  10. 深入了解A*

    一.前言 在这里我将对A*算法的实际应用进行一定的探讨,并且举一个有关A*算法在最短路径搜索的例子.值得注意的是这里并不对A*的基本的概念作介绍,如果你还对A*算法不清楚的话,请看姊妹篇<初识A ...