# what's in a process? ## PID process: "process #129, reporting for duty!" ## USER and GROUP "who are you running as?" process: "julia!" ## ENVIRONMENT VARIABLES like PATH! you can set them with: ``` env A=val ./program ``` ## SIGNAL HANDLERS process 1: "I ignore SIGTERM!" process 2: "I shut down safely!" ## WORKING DIRECTORY Relative paths (`./blah`) are relative to the working directory! `chdir` changes it. ## PARENT PID * PID 1 (init) is everyone's ancestor * (up arrow) PID 147 * (up arrow) PID 129 ## COMMAND LINE ARGUMENTS see them in `/proc/$PID/cmdline` ## OPEN FILES Every open file has an offset. process: "I've read 8000 bytes of that one" ## MEMORY heap! stack! shared libraries! the program's binary! mmaped files! ## THREADS sometimes one sometimes LOTS ## CAPABILITIES process 1: "I have CAP_PTRACE" process 2: "well I have CAP_SYS_ADMIN" ## NAMESPACES process 1: "I'm in the host network namespace" container process: "I have my own namespace!"
https://cdn.masto.host/socialjvnsca/media_attachments/files/109/717/270/012/329/142/original/734fb6acffede380.png