免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1765 | 回复: 9
打印 上一主题 下一主题

[系统管理] sysctl 的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-12-07 09:26 |只看该作者 |倒序浏览
本帖最后由 tenya 于 2015-12-07 10:30 编辑

我很奇怪,本来,我一开始执行sysctl -a看到很多信息的。后来记得我执行后 sysctl -w kernel.core_pattern=core.%p.%t 后,再用sysctl -a 查询一下,发现什么也看不到,变空了。请问哪位大哥知道这是怎么回事。
重启后也不行。

论坛徽章:
0
2 [报告]
发表于 2015-12-07 11:39 |只看该作者
sysctl -p: Load in sysctl settings from the file specified or /etc/sysctl.conf if none given.
or check the file /etc/sysctl.conf

论坛徽章:
0
3 [报告]
发表于 2015-12-07 13:59 |只看该作者
本帖最后由 tenya 于 2015-12-07 14:00 编辑

回复 2# tomshenhao

你看一下:

$ sysctl -p
[root] /root
$
$ cat /etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl( and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Disable netfilter on bridges.
#net.bridge.bridge-nf-call-ip6tables = 0
#net.bridge.bridge-nf-call-iptables = 0
#net.bridge.bridge-nf-call-arptables = 0

# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65536

# Controls the maximum size of a message, in bytes
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296

kernel.sem=550 320000 350 4096

#-----------------------------------------
net.ipv4.tcp_keepalive_intvl = 75
net.ipv4.tcp_keepalive_probes = 9
net.ipv4.tcp_keepalive_time = 300




   

论坛徽章:
0
4 [报告]
发表于 2015-12-07 16:54 |只看该作者
自己顶一下,不然就沉了。

论坛徽章:
0
5 [报告]
发表于 2015-12-08 04:07 |只看该作者
那你现在执行sysctl -a是什麽结果呢?

论坛徽章:
0
6 [报告]
发表于 2015-12-23 10:50 |只看该作者
回复 5# tomshenhao
没有什么东西,也是空的,你看:

[root] /root
$ sysctl -a
[root] /root

   

论坛徽章:
84
每日论坛发贴之星
日期:2015-12-29 06:20:00每日论坛发贴之星
日期:2016-01-16 06:20:00每周论坛发贴之星
日期:2016-01-17 22:22:00程序设计版块每日发帖之星
日期:2016-01-20 06:20:00每日论坛发贴之星
日期:2016-01-20 06:20:00程序设计版块每日发帖之星
日期:2016-01-21 06:20:00每日论坛发贴之星
日期:2016-01-21 06:20:00程序设计版块每日发帖之星
日期:2016-01-23 06:20:00程序设计版块每日发帖之星
日期:2016-01-31 06:20:00数据库技术版块每日发帖之星
日期:2016-01-16 06:20:00程序设计版块每日发帖之星
日期:2016-01-16 06:20:00程序设计版块每日发帖之星
日期:2016-01-14 06:20:00
7 [报告]
发表于 2015-12-23 23:07 |只看该作者
奇怪,什么系统?

执行下面的命令看看输出:
which sysctl
ls -l `which sysctl`
strace sysctl -a

论坛徽章:
0
8 [报告]
发表于 2015-12-29 12:40 |只看该作者
本帖最后由 tenya 于 2015-12-29 12:56 编辑

回复 7# yjh777

$ cat /etc/issue
Red Hat Enterprise Linux Server release 6.4 (Santiago)
Kernel \r on an \m

$ which sysctl
/sbin/sysctl
[root] /root

$ ls -l `which sysctl`
-rwxr-xr-x 1 root root 0 12月  4 15:40 /sbin/sysctl
[root] /root

$ strace sysctl -a
execve("/sbin/sysctl", ["sysctl", "-a"], [/* 33 vars */]) = -1 ENOEXEC (Exec format error)
write(2, "strace: exec: Exec format error\n", 32strace: exec: Exec format error
) = 32
exit_group(1)                           = ?
+++ exited with 1 +++
[root] /root

-------------------------------------------------------------
奇怪了,我的sysctl为何变成0大小了。

   

论坛徽章:
84
每日论坛发贴之星
日期:2015-12-29 06:20:00每日论坛发贴之星
日期:2016-01-16 06:20:00每周论坛发贴之星
日期:2016-01-17 22:22:00程序设计版块每日发帖之星
日期:2016-01-20 06:20:00每日论坛发贴之星
日期:2016-01-20 06:20:00程序设计版块每日发帖之星
日期:2016-01-21 06:20:00每日论坛发贴之星
日期:2016-01-21 06:20:00程序设计版块每日发帖之星
日期:2016-01-23 06:20:00程序设计版块每日发帖之星
日期:2016-01-31 06:20:00数据库技术版块每日发帖之星
日期:2016-01-16 06:20:00程序设计版块每日发帖之星
日期:2016-01-16 06:20:00程序设计版块每日发帖之星
日期:2016-01-14 06:20:00
9 [报告]
发表于 2015-12-29 13:04 |只看该作者
被人为破坏了,
    或者自己不小心执行什么操作时, 给清零了,,,

论坛徽章:
0
10 [报告]
发表于 2016-04-05 10:32 |只看该作者
回复 9# yjh777


是的,莫名文件被清了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP