什么是 .pid 文件,它包含什么? [英] What is a .pid file and what does it contain?

查看:31
本文介绍了什么是 .pid 文件,它包含什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近遇到了一个扩展名为 .pid 的文件,并在其中进行了探索,但没有找到太多内容.文档说:

I recently come across a file with the extension .pid and explored inside it but didn't find much. The documentation says:

Pid 文件是一个包含进程标识号 (pid) 的文件,该文件存储在文件系统的明确定义的位置,从而允许其他程序找出正在运行的脚本的 pid.

A Pid-File is a file containing the process identification number (pid) that is stored in a well-defined location of the filesystem thus allowing other programs to find out the pid of a running script.

谁能对此有更多的了解,或指导我了解 pid 文件中包含的内容的详细信息?

Can anyone shed more light on this, or guide me to details of what's contained in the pid file?

推荐答案

pid 文件包含给定程序的进程 ID(一个数字).例如,Apache HTTPD 可能将它的主进程号写入一个 pid 文件——它是一个普通的文本文件,仅此而已——然后使用其中包含的信息来停止它自己.您也可以使用该信息自行终止进程,使用 cat filename.pid |xargs 杀死

The pid files contains the process id (a number) of a given program. For example, Apache HTTPD may write its main process number to a pid file - which is a regular text file, nothing more than that - and later use the information there contained to stop itself. You can also use that information to kill the process yourself, using cat filename.pid | xargs kill

这篇关于什么是 .pid 文件,它包含什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆