LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 07: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, 08: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, 08: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, 01: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, 07:08 PM   #5
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
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, 01: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, 04:22 AM   #7
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
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



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 10:37 AM
how ctrl+c works to terminate a process rithik_ghoshal Linux - General 2 11-02-2008 08:01 AM
XAWTV works, videodog works, motion works but how to code my own? rylan76 Linux - Hardware 0 01-06-2006 06:30 AM
What process is changing /etc/fstab and deleting my swap mount? ffrr Linux - Software 8 03-18-2005 09:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:16 PM.

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
Open Source Consulting | Domain Registration