You are not logged in.

#1 2015-03-25 16:57:55

jernst
Member
From: Silicon Valley
Registered: 2014-03-04
Posts: 290
Website

To reboot or not?

Anybody have a good heuristic for when to reboot after a system upgrade, and when that is unnecessary?

Reboot should probably occur:

  • if the kernel was updated;

  • if systemd was updated;

  • if libc or something fundamental like it was updated.

If something like libssl was updated, a reboot might be unnecessary, but an apache restart might be in order. And an sshd restart. And ... I don't even know! In which case, perhaps it needs to be a reboot!

When do you reboot after upgrades?

Offline

#2 2015-03-25 17:03:02

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: To reboot or not?

The only update that requires a reboot to put the new stuff to use is a kernel update.  Why would you need to reboot for a libc update?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2015-03-25 17:04:53

jernst
Member
From: Silicon Valley
Registered: 2014-03-04
Posts: 290
Website

Re: To reboot or not?

Many running daemons use libc as a shared library? Let's say the libc update fixed a securtity problem.

Offline

#4 2015-03-25 17:06:32

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: To reboot or not?

Then restart those daemons.

A reboot only allows one to remain ignorant of what said daemons might actually be doing.  And by an extension of this logic, any update of anything can bring in new security patches/fixes, and therefore to ensure that all processes are restarted, a reboot is advisable after *any* update.  Of course I don't think this is the case.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2015-03-25 17:09:10

amish
Member
Registered: 2014-05-10
Posts: 470

Re: To reboot or not?

Basic rule is if you update any package and the executable / library in that package is in use. You need to restart that program / service.

If something like glibc or ssl (which is now used more or less by everything) is updated. Its best to reboot because that going to be faster way.

Offline

#6 2015-03-25 17:17:15

jernst
Member
From: Silicon Valley
Registered: 2014-03-04
Posts: 290
Website

Re: To reboot or not?

The only systematic way of doing this that I can think of is some version of this:

  • given the set of updated packages (S1)

  • determine the set of installed packages (S2) that have a (direct or indirect) dependency on one member of S1

  • determine the set of executables (E1) in S2

  • determine the list of executables (E2) currently running; this may be non-trivial because "bash foo.sh" runs both bash and foo.sh

  • intersect E1 and E2, to make E3

  • find the "correct" way of restarting each member of E3. This may be systemctl, but might not

I'm sure this algorithm is wrong is some way, which is sort of my point with this question. What do you guys do? Be as knowledgeable as possible, and hope for the best? :-) Or reboot all the time?

Offline

#7 2015-03-25 17:34:24

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: To reboot or not?

I envy you - I wish I had the time and brainpower to spare for worrying about reboot heuristics. smile

I reboot when the kernel upgrades - that's it. I've never experienced any adverse affects due to upgraded daemons that weren't restarted.

Offline

#8 2015-03-25 17:35:39

jernst
Member
From: Silicon Valley
Registered: 2014-03-04
Posts: 290
Website

Re: To reboot or not?

I have a fleet of machines for customers (each of which may have a different configuration), and I worry about missed security updates. I'd also like to avoid downtime aka reboot.

Last edited by jernst (2015-03-25 17:37:13)

Offline

#9 2015-03-25 21:08:46

Jristz
Member
From: America/Santiago
Registered: 2011-06-11
Posts: 1,022

Re: To reboot or not?

why not both?
kexec-tools and the nice script allan broke into here could be useful.


Well, I suppose that this is somekind of signature, no?

Offline

#10 2015-03-25 22:57:30

kete
Member
Registered: 2015-01-01
Posts: 36

Re: To reboot or not?

What if you update something and run `pactree -r' on it and find
systemd was one of the dependencies? Do you restart systemd, and if so,
how?

What if you find linux was one of the dependencies? Do you still keep
running or reboot?

What if you find some applications are dependencies: should you restart those?

Last edited by kete (2015-03-25 22:59:13)

Offline

#11 2015-03-26 03:27:06

jernst
Member
From: Silicon Valley
Registered: 2014-03-04
Posts: 290
Website

Re: To reboot or not?

kete: these are all good questions. So what do you guys do for your machines?

Offline

#12 2015-03-26 03:29:02

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: To reboot or not?

Not really a Pacman Issue, moving to GNU/Linux...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#13 2015-03-27 17:00:06

\hbar
Member
Registered: 2014-03-15
Posts: 165

Re: To reboot or not?

kete wrote:

What if you update something and run `pactree -r' on it and find
systemd was one of the dependencies? Do you restart systemd, and if so,
how?

What if you find linux was one of the dependencies? Do you still keep
running or reboot?

What if you find some applications are dependencies: should you restart those?

If a library is updated the programs that are linked against the library should be restarted in order to use the updated version. I don't think the kernel is dynamically linked, but systemd is. So if you update libc, then you'd have to restart systemd to have it load the new version of libc and therefore reboot. Right?

Another consideration is that if bash is updated, then you'll need to log out to restart the bash instance that you run when you log in.

I'd like to note that downtime itself is not an issue, what you want to avoid is having your daemons down. If you restart them, even without rebooting, they will be down for a short while. It'll be shorter than a reboot though.

I personnaly tend to reboot anytime a 'critical' library (e.g. libc) is updated on my servers,  and after every update on my desktop.

Last edited by \hbar (2015-03-27 17:01:03)

Offline

#14 2015-03-27 17:08:05

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,560

Re: To reboot or not?

\hbar wrote:

If a library is updated the programs that are linked against the library should be restarted in order to use the updated version. I don't think the kernel is dynamically linked, but systemd is. So if you update libc, then you'd have to restart systemd to have it load the new version of libc and therefore reboot. Right?

systemctl daemon-reexec

Offline

#15 2015-04-04 09:48:46

darthcookie
Member
Registered: 2015-04-04
Posts: 2

Re: To reboot or not?

Hi, I recently had this problem and found a script called checkrestart in debian-goodies. I managed to port it to pacman instead of dpkg, but it may be buggy, because I aren't exactly an expert in python.
Click me
Just put it in /usr/sbin and run it as root (guaranteed free of malware smile  It needs root access to check all open file descriptors)

Offline

#16 2015-04-04 19:32:22

jernst
Member
From: Silicon Valley
Registered: 2014-03-04
Posts: 290
Website

Re: To reboot or not?

Hey @darthcookie, this could be useful, but I'm not quite understanding the assumptions here. From my (cursory) look at the source code, it looks like this script looks at open files, and based on that, determines whether a restart is needed. What if a running executable read in a file that has been updated, but doesn't keep the file descriptor open?

Offline

#17 2015-04-04 23:01:56

darthcookie
Member
Registered: 2015-04-04
Posts: 2

Re: To reboot or not?

Hi, the script should indeed work like this, so it catches all changed executables and (dynamic linked) libraries. It is not able to detect cases of for example new config files, which are read on start up of the corresponding program, but these are created as .pacnew files when updated. Pacman does then inform the user about these files. So with the script and careful use of pacman, nearly all required restarts should be detectable.

Offline

#18 2015-04-05 09:15:53

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: To reboot or not?

Useful info:

$ cat /root/bin/stalelibs 
#!/bin/bash

# Must be run as root, to see *all* potentially dead libs.

# From http://forums.gentoo.org/viewtopic-t-842297.html
lsof | grep 'DEL.*lib'

# Just the summary
# http://forums.gentoo.org/viewtopic-p-7364130.html#7364130
#lsof | grep 'DEL.*lib' | cut -d' ' -f1 | sort -u

Offline

#19 2015-04-21 16:21:23

GI Jack
Member
Registered: 2010-12-29
Posts: 92

Re: To reboot or not?

jernst wrote:

Anybody have a good heuristic for when to reboot after a system upgrade, and when that is unnecessary?

Reboot should probably occur:

  • if the kernel was updated;

  • if systemd was updated;

  • if libc or something fundamental like it was updated.

I think you answered your own question.

Also, reloading/restarting apache, or whatever when some component it uses gets upgraded.

some daemons also need a systemctl daemon-reload after upgrades.

Offline

#20 2015-08-29 15:58:00

kahrkunne
Member
Registered: 2013-08-24
Posts: 88

Re: To reboot or not?

I reboot whenever I run into trouble. Generally this is from things like mount not working anymore after a kernel update, not being able to start games anymore after a graphics card driver update, etcetera.
Also I reboot whenever I run into a generic issue where I don't know the cause, because often just rebooting fixes whatever was wrong.

Offline

#21 2015-08-30 17:57:35

cammyman50
Member
Registered: 2014-06-01
Posts: 48

Re: To reboot or not?

I generally reboot less then a week or bi weekly If a kernel update has been applyed, or I ended up with a large chunk of updates because I am on a trip or something.

Other then that, I haven't run into trouble with anything other then upstream issues like Xfce issues with font rendering with asian characters. Or a crash from flashplayer. Both of which are fixed. and flashplayer defenestrate a long time ago.

Last edited by cammyman50 (2015-08-30 17:58:17)

Offline

Board footer

Powered by FluxBB