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

查看:252
本文介绍了什么是.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-File是一个包含进程标识号(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 kill

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天全站免登陆