Linux。如何禁用所有日志?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17358499/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Linux. How to disable all log?
提问by Andrei
Is it possible to disable logging on linux (ubuntu)? Need to turn off the svn, jabber, apache, proftpd, sendmail, ssh, vpn, mysql and all system logs.
是否可以在 linux (ubuntu) 上禁用日志记录?需要关闭svn、jabber、apache、proftpd、sendmail、ssh、vpn、mysql和所有系统日志。
回答by Sebastian Lange
Stop Log Daemon syslogd.
停止日志守护进程syslogd。
For example by using init-scripts:
例如通过使用初始化脚本:
/etc/init.d/syslogd stop
Depending on your Linux-Dist this can be achived in different ways. For disable logging permanantly (embedded system with low disk space) remove loggind deamons, edit /etc/defaults or remove init scripts from the rc (runlevel-configuration) directories.
根据您的 Linux-Dist,这可以通过不同的方式实现。要永久禁用日志记录(具有低磁盘空间的嵌入式系统),请删除 loggind 守护程序,编辑 /etc/defaults 或从 rc(运行级别配置)目录中删除 init 脚本。
Edit: much more of interest would be, what causes your latency problems. I do not believe the logs would cause this. Run "top -d1" and check the most upper processes. A network home server for example would probably not need the XWindow System. If you are not running web-development on this machine also Database and Webser will probably be of no need... A lot of processes can cause lags.
编辑:更有趣的是,是什么导致了您的延迟问题。我不相信日志会导致这种情况。运行“top -d1”并检查最上层的进程。例如,网络家庭服务器可能不需要 XWindow 系统。如果你不在这台机器上运行 web 开发,那么数据库和 Webser 可能也不需要......很多进程会导致滞后。
回答by Nicolas Guérinet
Syslog has been replaced by rsyslog on numerous OS. So, on Debian > 5, Ubuntu > 11.2, Centos 6.x the following command line would stop it:
在许多操作系统上,Syslog 已被 rsyslog 取代。因此,在 Debian > 5、Ubuntu > 11.2、Centos 6.x 上,以下命令行将停止它:
service rsyslog stop
Then, you can disable it at boot:
然后,您可以在启动时禁用它:
systemctl disable rsyslog
to enable it again at boot:
在启动时再次启用它:
systemctl enable rsyslog
回答by Chenming Zhang
if you are running systemd, issuing the command below:
如果您正在运行systemd,请发出以下命令:
systemctl disable syslog
回答by Cloud
If you went disable syslog, please running this command:
如果您禁用 syslog,请运行以下命令:
sudo systemctl disable rsyslog
回答by baumann
If (like some of us) you have really old legacy systems:
如果(像我们中的一些人一样)你有非常旧的遗留系统:
% /etc/init.d/syslog stop
% chkconfig syslog off