LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-01-2010, 08:55 AM   #1
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Rep: Reputation: Disabled
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?
 
Old 06-01-2010, 09:12 AM   #2
alli_yas
Member
 
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 92
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>
If you delete the binaries and reboot - definitely the process will not be started (if you have a startup script it should fail).

PS: Be careful with the kill command (especially the -9 option) - this will forcefully kill any process you specify which can cause problems.
 
Old 06-01-2010, 09:20 AM   #3
cospengle
Member
 
Registered: Feb 2008
Location: Armidale, NSW, Australia
Distribution: Fedora 8
Posts: 32

Rep: Reputation: 6
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).
 
Old 06-01-2010, 02:12 PM   #4
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Original Poster
Rep: Reputation: Disabled
Can I kill processes with htop by "SIGTERM"?
 
Old 06-01-2010, 08:08 PM   #5
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,425

Rep: Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826
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.
 
Old 06-02-2010, 02:36 AM   #6
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Original Poster
Rep: Reputation: Disabled
Sure, I meant
Code:
apt-get purge ...
 
Old 06-02-2010, 05:22 AM   #7
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
Quote:
Originally Posted by cospengle View Post
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
I don't think that is exactly correct.

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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding the Process ID of a Process While Initiating the Process senthilmuthiah Linux - Newbie 7 04-02-2009 11:37 AM
how ctrl+c works to terminate a process rithik_ghoshal Linux - General 2 11-02-2008 09:01 AM
XAWTV works, videodog works, motion works but how to code my own? rylan76 Linux - Hardware 0 01-06-2006 07:30 AM
What process is changing /etc/fstab and deleting my swap mount? ffrr Linux - Software 8 03-18-2005 10:16 PM


All times are GMT -5. The time now is 04:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration