diff --git a/.zk/notebook.db b/.zk/notebook.db index 38fce21..8a6c79a 100644 Binary files a/.zk/notebook.db and b/.zk/notebook.db differ diff --git a/zk/Processes.md b/zk/Processes.md index 3633b9a..18cfdb0 100644 --- a/zk/Processes.md +++ b/zk/Processes.md @@ -5,7 +5,7 @@ tags: [operating-systems] created: Friday, June 21, 2024 --- -# Processes +# Processes and threads Programs are sequences of machine instructions stored in a file. However they do not work by themselves. Something needs to load the file's intructions into @@ -26,6 +26,24 @@ It is possible that a parent process will terminate before one of its child processes. In this instance the child becomes an orphan. When this occurs in #Linux, the orphan process is adopted by `init`. +Below, I have used the `pstree` utility to list all the running processes on my +machine hierarchically. + +![diagram of `pstree` output](../img/ps-tree.png) + +Children are represented vertically and horizontally. + +``` +├─terminator─┬─zsh───tmux: client +│ ├─zsh───pstree +│ └─6*[{terminator}] + +``` + +For instance here, `terminator` is a child of `init`, as are `zsh` and `tmux` +but they are also children of `terminator`.`pstree` is a child of `zsh` and +therefore also a child (grandchild) of `terminator`. + ## Related notes ![systemd](./systemd.md) diff --git a/zk/systemd.md b/zk/systemd.md index 7208bc6..0aa08b5 100644 --- a/zk/systemd.md +++ b/zk/systemd.md @@ -20,7 +20,7 @@ succession at boot time it is not limited to the this stage of the lifescycle but runs continuously in reponse to new user events. On Linux systems `systemd` is used to implement `init` and therefore `systemd` -will always be listed as the first process (PID1) +will always be listed as PID1. `systemd` is directly accessible from user space and provides a straightforward way to enable/disable, start/stop system level processes