linux 同步时间 调试core内核

1.同步时间

#chkconfig --list | grep ntp

ntpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
ntpdate 0:off 1:off 2:off 3:off 4:off 5:off 6:off

#chkconfig ntpdate on // 自启动。

#service ntpdate start // 开启此服务

#date // 此时时间即已更新

方法2:

ntpdate time.nist.gov

2.调试core信息

// 设置core大小为无限

#ulimit -c unlimited

#./test // 执行完,因段错误退出后会生成一个core.xxx 文件

#gdb test core.xxx

用bt命令查看backtrace以检查发生程序运行到哪里,来定位core dump的文件、行。

// 调试完关闭 dump

#ulimit -c 0 // 把大小设置为0 即可

原文地址:https://www.cnblogs.com/sylar-liang/p/4711567.html