过程识别
假设我有 15 个进程/守护进程在后台运行。 假设其中一个进程已转储核心。
我如何确定哪个进程已转储核心。
我正在使用hpux!
Let's say i have 15 processes/daemons running in the background.
let's say one of the process has dumped the core.
how could i identify which process has dumped the core.
i am using hpux!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
1)如果进程具有相同的名称,那么我认为您必须从不同的文件夹运行它们。如果进程转储核心,您将在其文件夹中找到它。
我不知道你是如何开始它们的。如果您使用
&
启动进程,则可以使用$!
获取最后启动的守护进程的 PID,从而将进程的 PID 保存在其文件夹中。或者您可以查看此文件夹中守护进程的日志,并从中获取此文件夹中进程的 PID。
2)如果您运行不同的应用程序,您可以使用
file ./core
来查找应用程序的名称。更新:
3) 刚刚阅读了此内容:
首先运行
coreadm -p core.%p.%f.%t.%n
或将此命令放入您的配置文件中。然后,如果应用程序进行核心转储,您将看到一个名为
core....
的核心文件。例如:core.29305.main.1278939422:531259.srv2-rx81) If processes have the same name then I think you have to run them from different folders. If a process dumps a core you will get it in its folder.
I don't know how you start them. If you use
&
to start a process then you can use$!
to get PID of the last started daemon process and thus save the PID of the process in its folder.Or you can take a look at the log of your daemon in this folder and get PID of the process in this folder from there.
2) If you run different applications you can use
file ./core
to find out the name of the application.Updated:
3) Have just read about this:
Run first
coreadm -p core.%p.%f.%t.%n
or put this command in your profile.And then if an application coredumps you will see a core file with name
core.<PID>.<Application-Name>.<Timestamp>.<Server>
. For example:core.29305.main.1278939422:531259.srv2-rx8
它可以将 pid 写入文件名的一部分。我不知道您启动什么或如何启动 15 个进程,但存储 pid 是很常见的。守护进程通常会创建自己的 pid 文件,其中包含标识实例的内容。
It can write the pid as part of the filename. I don't know what or how you start your 15 processes but it is common to store the pid. Daemons usually create their own pid file with something that identifies the instance.
它应该位于转储期间生成的索引文件中。 HPUX 10.26(非常旧)将转储保留在:
您将需要 q4 或类似的工具来调查转储。要将模式设置为 epronk 建议的模式,您需要 coreadm。请参阅手册页:
It should be in the index file generated during the dump. HPUX 10.26 (really old) kept the dumps in:
You will be needing q4 or a similar tool to investigate the dump. To set the pattern as epronk suggested, you'll need coreadm. Consult the manual pages: