LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-12-2023, 09:38 PM   #1
unstamped
LQ Newbie
 
Registered: Sep 2023
Distribution: ArchLinux
Posts: 13

Rep: Reputation: 0
What would be the difference between a reboot and killing all existing processes?


Hello.

I was reading about killing processes in linux and found the killall to be different in Solaris than in any other distribution. As you very well know, running killall in Solaris will kill all existing processes. And I was thinking, what would be the difference between rebooting a linux machine and just killing every process (leaving it similar to a rebooted state)?

Thank you.
 
Old 12-12-2023, 09:42 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,380
Blog Entries: 28

Rep: Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163Reputation: 6163
Just my thoughts:

Rebooting clears out the dust bunnies in memory. Killing processes does not. The processes are gone, but the dust bunnies are still there.

Also, depending on the update status, a reboot might be necessary to enable new functions, particularly new kernels.
 
1 members found this post helpful.
Old 12-12-2023, 09:46 PM   #3
unstamped
LQ Newbie
 
Registered: Sep 2023
Distribution: ArchLinux
Posts: 13

Original Poster
Rep: Reputation: 0
But if you kill a process, won't all of its used memory be cleared out along side the process itself?
 
Old 12-12-2023, 10:02 PM   #4
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,471
Blog Entries: 7

Rep: Reputation: 2572Reputation: 2572Reputation: 2572Reputation: 2572Reputation: 2572Reputation: 2572Reputation: 2572Reputation: 2572Reputation: 2572Reputation: 2572Reputation: 2572
"Dust bunnies," eh? Is that a technical term?

Either way, they don't exist in Linux because Linux manages memory properly, and this is precisely the reason why an Android phone can run for months/years between reboots.

The technicalities of it are explained quite well here: https://unix.stackexchange.com/quest...kill-a-process
 
1 members found this post helpful.
Old 12-12-2023, 11:52 PM   #5
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,762

Rep: Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763
Killall (as most commonly implemented in Linux) may not in fact actually kill all (or any) processes! It sends a signal (generally sigterm if not spcified, check the man page for your implementation) to all running user processes and the return value indicates success if AT LEAST ONE process actually exits. Note that many server processes and the kernel are not even considered in most implementations. Other processes process the signal as they are coded to do, which may or may not result in an exit.

A reboot flushes all queues, resets all hardware devices, and starts server processes to include the kernel to the warm-boot level. Only a cold boot gives you a more clean system state.

The difference is significant, but how significant for your purposes depends upon what your purpose IS!
 
1 members found this post helpful.
Old 12-13-2023, 12:50 AM   #6
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,680
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
A reboot will kill zombies and nothing else will.
 
2 members found this post helpful.
Old 12-13-2023, 01:05 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,038

Rep: Reputation: 7346Reputation: 7346Reputation: 7346Reputation: 7346Reputation: 7346Reputation: 7346Reputation: 7346Reputation: 7346Reputation: 7346Reputation: 7346Reputation: 7346
if you could successfully kill all (I mean every single) process, you'd have to reboot the host because it would be unusable. The command killall doesn't meant to do that, see post #5.
Reboot does much more, it's not just a kill command, that's the difference.
 
1 members found this post helpful.
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kill in script not killing all processes (HPUX) SmurfGGM Linux - General 1 01-30-2015 04:30 AM
Killing all remainig processes ....failed during debian/lenny shutdown process. sarajevo Debian 7 12-11-2008 07:26 PM
Bash behaviour difference between foregorund and background processes 0p3r4t4 Programming 8 10-28-2008 03:48 PM
What would be the difference between 6.10 with all updates and 7.10? taylorkh Ubuntu 2 05-30-2008 08:02 AM
killing all of a user's processes thebeaglebeagle Linux - Software 1 09-04-2003 11:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:21 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
Open Source Consulting | Domain Registration