pid

where does top gets real-time data

最后都变了- 提交于 2019-12-12 09:35:24
问题 Where does top application gets it's data on Linux? I would be interested in real-time CPU load/pid data.(I read allmost all documentation in /proc/pid man page, but the info isn't there). The pid is a jboss. I need the data lightweight (to be exported easily). 回答1: As documented in proc(5), in the file /proc/(pid)/stat you have the fields: utime %lu Amount of time that this process has been scheduled in user mode, measured in clock ticks (divide by sysconf(_SC_CLK_TCK). This includes guest

nginx.conf and nginx.pid users and permissions

我怕爱的太早我们不能终老 提交于 2019-12-12 08:53:49
问题 I'm embarking on watching my NGINX error.log files at level: warn... probably a silly idea and will cause me to crash my server as I work out any bugs happening, but hey, we're nerds and this is why we're here. I'm noticing a [warn] and an [emerg] pop up every time I restart my server, which shows: [warn] 8041#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1 [emerg] 8041#0: open() "/run/nginx.pid" failed (13:

Find tmux session that a PID belongs to

本秂侑毒 提交于 2019-12-12 08:05:54
问题 I am using htop so see what processes are taking up a lot of memory so I can kill them. I have a lot of tmux sessions and lots of similar processes. How can I check which tmux pane a PID is in so I can be sure I am killing stuff I want to kill? 回答1: Given that PID in the below line is the target pid number: $ tmux list-panes -a -F "#{pane_pid} #{pane_id}" | grep ^PID The above will identify the pane where the PID is running. The output will be two strings. The first number should be the same

How to get the PID of running application in Windows?

不羁的心 提交于 2019-12-12 02:36:06
问题 I have here my code snippet: ArrayList<String> cmd_exec_installer = new ArrayList<String>(); cmd_exec_installer.add("file.exe"); Process proc = new ProcessBuilder(cmd_exec_installer).start(); What I want to do is to get the PID of the process started executing file.exe . Is there a way to do that in Java? 回答1: This question was already answered here and here. Basically, there's no simple way to achieve the task, unless you use the JNI libraries or reflection, as suggested in the linked

wait for two PID in c-shell

帅比萌擦擦* 提交于 2019-12-12 02:23:18
问题 Following works for me: >sleep 20 & [1] 30414 >sleep 30 & [2] 30415 >wait $30414 $30415 This works all right until I want to write this into tmp.csh In my tem.csh file sleep 20 & set pid1=$! sleep 30 & set pid2=$! When it comes to "wait" wait $pid1 $pid2 => too many arguments wait $pid1 => too many arguments wait \$$pid1 => too many arguments wait $($pid1) => Illegal variable name How shall I write it? And this question is for a solution of How can I wait until specified "xterm" finished? 回答1

How to perform back button action in another app?

你说的曾经没有我的故事 提交于 2019-12-12 01:44:54
问题 i want simple app to kill the activity from the stack in current visible activities... How to implement the app to run in background and close activities in running apps? 回答1: Assuming these are your own activities, you need to declare an action on the activity you want to be closeable, then call that action from the other app. The closing activity will get notified in onNewIntent() where you can check the action and call finish In closable activity: @Override protected void onNewIntent

403 Forbidden: directory index of “/path/to/files” is forbidden Nginx

十年热恋 提交于 2019-12-11 19:53:40
问题 I want to be really careful here because I just had to destroy my entire server and build again from scratch (total nightmare) because I tried fixing this error following advice such as sudo chown -R user:user * sudo chmod 755 [directory name] sudo chmod 644 * and ended up severely screwing up my permissions and breaking the whole Ubuntu system. I've also followed the advice from other similar questions to take out the second $uri from my Nginx config and that has not fixed the problem. My

How can I get the process descriptor from a PID in Linux kernel?

ε祈祈猫儿з 提交于 2019-12-11 17:04:33
问题 I am trying to figure out how to get the process descriptor from a PID. From http://www.linuxforums.org/forum/kernel/153873-getting-task_struct-process-using-its-pid.html, for Linux kernel 2.4 static inline struct task_struct *find_task_by_pid(int pid) { struct task_struct *p, **htable = &pidhash[pid_hashfn(pid)]; for(p = *htable; p && p->pid != pid; p = p->pidhash_next) ; return p; } The link seems to say that pidhash[pid_hashfn(pid)] is a pointer to a task_struct object whose PID is value

Find Window and change it's name

谁说胖子不能爱 提交于 2019-12-11 13:29:21
问题 Sup What i'm trying to do is a way to find a window though it's process ID, get the name of that window and change it to something that i want. I found some things about that : ( Code 1 ) int WINAPI GetWindowText( _In_ HWND hWnd, _Out_ LPTSTR lpString, _In_ int nMaxCount ); this : ( Code 2 ) CWnd* pWnd = GetDlgItem(); GetDlgIt pWnd->SetWindowText(_T("WindowName")); CString str; pWnd->GetWindowText(str); ASSERT(str == _T("WindowName")); and also this ( Code 3 ) HWND WindowHandel = FindWindowA

How to get a process id of exe running through java program

强颜欢笑 提交于 2019-12-11 08:56:20
问题 I am running a exe through java runtime api Process process = runTime.exec("cmd.exe /c start abc.exe "+Id, null, new File("D:/My")); and retrieving the process id using jna like this - Kernel32.INSTANCE.GetProcessId((Long) f.get(process)); but the process id return is not of abc.exe but of cmd.exe ..... i need the process id of abc.exe . Do not know how to get that can anyone help. 回答1: The process is an object of type java.lang.Process . You can get the process id of abc.exe by using the