作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我找到了很多关于 psacct
的文档,但它们都在说明用法,而不是它是如何工作的。
我真的很想知道流程会计是如何工作的:
系统的哪一部分记录有关进程的信息?
它是如何工作的?
我在 RHEL 6.5 上安装了 psacct。
服务启动脚本 (/etc/init.d/psacct) 调用这个:
/sbin/accton $ACCTFILE
/sbin/accton调用系统调用acct()
男人帐户
描述 acct() 系统调用启用或禁用进程记帐。如果以现有文件的名称作为参数调用,accounting 是 打开,并且每个终止进程的记录在它终止时附加到文件名。 NULL 参数导致记帐 关闭。
最佳答案
您的问题的答案在 linux 源文件中 kernel/acct.c
.特别是在 fill_ac function
/*
* Write an accounting entry for an exiting process
*
* The acct_process() call is the workhorse of the process
* accounting system. The struct acct is built here and then written
* into the accounting file. This function should only be called from
* do_exit() or when switching to a different output file.
*/
static void fill_ac(acct_t *ac)
关于linux - Linux 进程记帐 (psacct) 是如何工作的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29246631/
我找到了很多关于 psacct 的文档,但它们都在说明用法,而不是它是如何工作的。 问题 我真的很想知道流程会计是如何工作的: 系统的哪一部分记录有关进程的信息? 它是如何工作的? 已经完成 我在 R
我是一名优秀的程序员,十分优秀!