[HN Gopher] So, what can you do with a process ID?
___________________________________________________________________
So, what can you do with a process ID?
Author : gcmeplz
Score : 20 points
Date : 2022-12-16 16:31 UTC (6 hours ago)
(HTM) web link (will-keleher.com)
(TXT) w3m dump (will-keleher.com)
| tdoot wrote:
| Interesting there's no mention of the _/ proc_ filesystem
| (https://docs.kernel.org/filesystems/proc.html).
|
| _cat /proc/<pid>/environ_ would be a solid addition to this
| list.
| ghostpepper wrote:
| My go-to incantation is `ps ajxf`, (truncated and edited) sample
| output below PPID PID PGID SID TTY
| TPGID STAT UID TIME COMMAND 0 1 1 1 ?
| -1 Ss 0 0:57 /sbin/init splash 1 978 978
| 978 ? -1 Ss 0 0:00 /usr/sbin/sshd -D
| 978 11441 11441 11441 ? -1 Ss 0 0:00 \_ sshd:
| ghostpepper [priv] 11441 11445 11441 11441 ? -1 S
| 1000 0:00 \_ sshd: ghostpepper@pts/4 11445 11446
| 11446 11446 pts/4 11641 Ss 1000 0:00 \_ -bash
| 11446 11641 11641 11446 pts/4 11641 R+ 1000 0:00
| \_ ps ajxf
|
| Another thing some might not know is that kill (the command /
| syscall) can send a lot of other signals than KILL (the signal).
| Not all processes know how to gracefully handle them, so you need
| to be careful, but for example a lot of daemons can catch SIGHUP
| and re-load their config file from disk.
| hsfzxjy wrote:
| And with strace -p pid you can somewhat "spy" on what a process
| is doing.
| crossingTime wrote:
| When I was a chemist we used photoionization detectors to detect
| VOCs in groundwater.
| daniel-s wrote:
| For a moment I thought the topic was about PID controllers. That
| would have been cool.
|
| If the blogging gods take requests I just made one.
| dang wrote:
| In the meantime, we've macroexpanded that acronym in the title
| above.
| yakubin wrote:
| On Linux one of my favourite tools to display metrics about a
| process in real time, such as cpu/memory/io utilisation, which
| can also be broken down per thread (with friendly thread names
| displayed if your application sets them), is pidstat from the
| sysstat package.
___________________________________________________________________
(page generated 2022-12-16 23:01 UTC)