Process works after deleting it?
If I delete some program, let's say - PulseAudio, it still runs and I need to kill this process. Why? How can it work if it's no more on the HDD? And if I just reboot the PC after deleting PulseAudio (without killing it), it won't be in memory then?
|
From what I understand if you've started a process that loads the application into memory, deleting the binary doesn't kill the process.
You'd need to explicitly do a Code:
# kill -9 <PID> PS: Be careful with the kill command (especially the -9 option) - this will forcefully kill any process you specify which can cause problems. |
A process is a running program. It is not exactly the same as having a program stored on a hard disk.
When you run a program, the file containing the program is read into your system's memory and the process uses this information to run. If you delete the file in secondary storage (on your hard disk) the program is still contained in the memory so it can still run until the memory is cleared (in the case of virtual memory systems, this generally happens when the process is terminated or the system reboots). When you restart your system, if your program is not on your hard drive it can't be loaded back into memory (also, since there is no program to run, the operating system won't create a new process at all). |
Can I kill processes with htop by "SIGTERM"?
|
I am hoping by 'delete' you mean you uninstalled the application/driver as simply deleting could cause issues for other programs who are still looking for this information.
|
Sure, I meant
Code:
apt-get purge ... |
Quote:
When you run a program, the file containing the program is mapped into your virtual address space. Individual pages are read on demand. The file is still required. If you tell the OS to delete the file, the directory entry will go away. But the OS will recognize that a process still needs the file and won't really delete the file. When the process closes the file, the OS will remember that the file has no directory entry and will delete it then. |
All times are GMT -5. The time now is 04:15 PM. |