9

I always shut down my Ubuntu MATE 16.04 system in exactly the same way: I keep hitting alt+F4 until I get to the very last terminal window and all other applications have been exited, and then I type poweroff

Despite the consistency of my procedure, the time taken by the system to fully shut down (ie the amount of time I'm watching the splash screen) varies a lot, from about 3 seconds to about 25 seconds. Why does this happen, or how can I find out?

I know I can read the logs, but I would love some tips on how to analyse for this

4
  • I could be way off here, but I remember reading about how Firefox has some sort of garbage collection and cleanup that could run after the Fx gui is closed.
    – DK Bose
    Jul 22, 2016 at 0:17
  • Could be your internet connection. There will be a "ifdown" during shutdown and that can vary in time. Next you could run into a crash where the system tries to redo that command that crashed and gives up after some seconds. And yes: '/var/log/` is the place to start looking
    – Rinzwind
    Jul 22, 2016 at 7:00
  • @Rinzwind thanks for the hint! but where in /var/log/? of course I have been to this place, but I want to know what to look for...
    – Zanna
    Jul 22, 2016 at 7:03
  • /var/log/syslog or /var/log/messages. Probably the 1st one. The 2nd one is not likely to be there on Ubuntu ;) Other tip: you can probably still have the shutdown show you the text on screen
    – Rinzwind
    Jul 22, 2016 at 7:04

1 Answer 1

6

From man 8 shutdown:

   Once  TIME  has elapsed, shutdown sends a request to the init(8) daemon
   to bring the system down into the appropriate runlevel.

   This is performed by emitting the runlevel(7) event, which includes the
   new  runlevel  in  the  RUNLEVEL  environment  variable  as well as the
   previous runlevel (obtained from the environment or from /var/run/utmp)
   in  the  PREVLEVEL  variable.   An additional INIT_HALT variable may be
   set, this will contain the value HALT when bringing the system down for
   halt and POWEROFF when bringing the system down for power off.

Then, each and every daemon process recognizes the change in RUNLEVEL, and takes appropriate action. This could be anything from a quick exit to a configuration save to a cache flush or even a whole database freeze.

Depending on what level of logging you have set up for each daemon. you may see some information in /var/log/* and subdirectories of /var/log/.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .