pid

MacOSX: find out if a process (given a PID) is running in 32bit or in 64bit Intel mode

泄露秘密 提交于 2019-12-06 07:22:57
I have a PID and I want to find out if the process is running in 32bit or in 64bit Intel mode. How? I can do via NSRunningApplication . [[NSRunningApplication runningApplicationWithProcessIdentifier:pid] executableArchitecture] returns the Mach-O architecture constant . This works only for GUI applications, though... 来源: https://stackoverflow.com/questions/7335245/macosx-find-out-if-a-process-given-a-pid-is-running-in-32bit-or-in-64bit-inte

MySQL: error on El Capitan OS after Yosemite OS update

雨燕双飞 提交于 2019-12-06 06:11:04
I have problems with MySQL on my MacBook. I had updated my OS from Yosemite to El Capitan before I installed MySQL server. Now, when I try to run MySQL on Terminal, I got the error like this ERROR! The server quit without updating PID file Anyone can help me please? Thanks a lot! Try updating your my.cnf file to set the location of the PID file manually. Here's how you do that. In your Terminal run the following command. ps -ax | grep mysql This will list all the locations of the important mysql files. Look for the path of the --pid-file I will look something like this: --pid-file=/path/to

pid 控制

倾然丶 夕夏残阳落幕 提交于 2019-12-06 05:40:39
static std::map< pid_t, TTask *> Tasks; TError TTask::Fork(bool detach) { PORTO_ASSERT(!PostFork); auto lock = std::unique_lock<std::mutex>(ForkLock); ForkTime = time(NULL); localtime_r(&ForkTime, &ForkLocalTime); pid_t ret = fork(); if (ret < 0) return TError::System("TTask::Fork"); Pid = ret; if (!Pid) PostFork = true; else if (!detach) Tasks[Pid] = this; Running = true; return OK; } TError TTask::Wait() { auto lock = std::unique_lock<std::mutex>(ForkLock); if (Running) { pid_t pid = Pid; int status; lock.unlock(); /* main thread could be blocked on lock that we're holding */ if (waitpid(pid

Java, Checking if any process ID is currently running on Windows

浪尽此生 提交于 2019-12-06 03:20:30
问题 Is it possible to check the existence of process from Java in Windows. I have its possible PID, I want to know if it is still running or not. 回答1: See if this can help: http://blogs.oracle.com/vaibhav/entry/listing_java_process_from_java That post explains how to get all PIDs running on a Windows machine: you'd have to compare the output of the cmd call with your PID, instead of printing it. If you're on Unix-like systems you'd have to use with ps instead of cmd Calling system commands from

windows 端口占用

こ雲淡風輕ζ 提交于 2019-12-06 02:38:01
1.查看所有连接的PID 开始--运行--cmd ,输入netstat -ano 2.查看占用8080端口程序 netstat -ano|findstr "8080" 协议 本地地址 外部地址 状态 PID TCP 127.0.0.1:1433 0.0.0.0 LISTENING 4984 tasklist|findstr "4984" 映像名称 PID 会话名 会话# 内存使用 sqlservr.exe 4984 Services 0 51,844 K P:很清楚吧,是sqlserver服务占用端口”1433“,然后Kill 之。 3.结束该进程 taskkill /f /t /im sqlservr.exe 或者 taskkill /F /pid “4984       来源: https://www.cnblogs.com/yoyo1216/p/11957777.html

How to find Bundle Identifier from known PID?

社会主义新天地 提交于 2019-12-06 02:14:02
问题 I have the pid (process identifier) of an arbitrary running process. How can I find the bundle identifier (if any) of the associated application? 回答1: Here's a way that works in 10.2 and later: First call GetProcessForPID to turn the pid into a ProcessSerialNumber . Then call ProcessInformationCopyDictionary to get the bundle ID. (Added: these functions are deprecated in OS 10.9. I don't know if they still exist in the 10.10 SDK.) 回答2: I've found an answer which works on 10.6 only: [

Windows8中pid为4的system进程占用80端口的解决办法

穿精又带淫゛_ 提交于 2019-12-05 23:56:50
因为Apache无法启动的原因,用netstat命令查看了一下80端口是否被占用了,如下 C:\Users\Maple>netstat -ano | findstr 0.0.0.0:80 TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 4 果然是被占用了,进程PID为4,进任务管理器去查看,PID为4的进程为system,系统进程。 网上搜搜,发现system进行是系统服务进程,系统服务都会由这个进程来启动。 了解到是http的系统服务,结果在系统服务services.msc中没找到,于是去cmd中去停止 C:\Users\Maple>net stop http 你想继续此操作吗? (Y/N) [N]: Y 发生系统错误 5。 拒绝访问。 以管理员权限运行c:\windows\system32\cmd.exe C:\WINDOWS\system32>net stop http HTTP Service 服务已成功停止。 C:\WINDOWS\system32>netstat -ano | findstr 0.0.0.0:80 C:\WINDOWS\system32>sc config http start=disabled [SC] ChangeServiceConfig 成功 再查看80端口,果断被释放了。 来源: oschina 链接: https:/

OSX - How can I see the TID of all threads from my process?

坚强是说给别人听的谎言 提交于 2019-12-05 23:53:14
问题 On Linux ps -eLf | grep my-process-name gives a list of the threads within my process along with the TID of each thread. On OSX ps -M pid gives me the list of the threads but does not show the TID of each thread. How can I see thread TIDs under a single process from the command line? 回答1: You can't see the TIDs with the ps on Mac OS as you can experience while listing all the possible column options with ps L . Anyway, if you dont mind exploring the threads as a root, you can use dtruss,

python 设置运行进程的CPU

☆樱花仙子☆ 提交于 2019-12-05 20:41:38
Nginx服务器会把自己的每个worker进程绑定到一个CPU上,以期减少进程间切换所带来的开销,最大限度利用多核框架。在实现上,使用Linux的sched_setaffinity()这个函数来实现。第三方库affinity封装了该函数,使得我们可以将python的进程绑定到指定的CPU上。 用法非常简单 affinity.get_process_affinity_mask(pid) #查看pid这个进程用了哪一个CPU affinity.set_process_affinity_mask(pid, 2L) #设置pid在2这个进程上运行 如果你的机器不是多核的,也就没有必要这么设置了,毕竟只有一个CPU。那么如何知道自己的机器有几颗CPU呢? #coding=utf-8 import psutil p = psutil.Process() pro_info = p.as_dict(attrs=['pid', 'name', 'username']) print psutil.cpu_count() psutil开源库,可以获取系统状态,通过它可以知晓机器的CPU个数 来源: CSDN 作者: 酷python 链接: https://blog.csdn.net/KWSY2008/article/details/52041768

【linux】linux命令lsof和grep命令的配合使用---linux根据端口查看PID,根据PID关键字高亮显示

﹥>﹥吖頭↗ 提交于 2019-12-05 19:32:20
lsof命令,根据端口,查看进程PID lsof -i:8168 ps命令+grep命令 --color参数,根据PID查看进程详情,高亮显示关键字 ps -ef | grep 8168 --color=always 来源: https://www.cnblogs.com/sxdcgaq8080/p/11941690.html