[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Avoid reboot by loading initramfs again



On Sun, Oct 19, 2014 at 10:36:23PM +0200, Jimmy Thrasibule wrote:
> Hello,
> 
> I wonder if one can avoid a complete reboot of the system just by
> halting the operating system but right after load the initramfs and
> restart from there?

I don't think you can quite do what you're thinking, but there are other
ways around it.

> 
> Basically when we reboot, we only want to reset the operating system
> state but rarely to do all the hardware checks again. And for a kernel
> update, there is kexec.

If you've got as far as halting  the system, then kexec or a full reboot
are your only options. This is due to the fact that you've unmounted all
the block  devices, probably  powered them  off and so  on. I  guess you
could try  jumping back into an  initramfs (that you loaded  into memory
before shutdown), but you might as  well reset the kernel at that point.
It'll only take a few seconds more.

The other alternative,  for a "lighter" reboot is to  drop to runlevel 1
(or single-user.target, in  systemd's parlance). This will  stop all the
mutli-user services (X, httpd, sshd and so  on) and bring you to a point
where only  a minimal number of  services are running (file  systems are
mounted,  the  local  console  is  active and  so  on).  You  could  use
"checkrestart" (from the debian-goodies package) to check what remaining
services are using outdated libraries and restart them manually. At this
point, you can come back up to runlevel 2-5 (systemd: multi-user.target)
in order to bring the system back up to full capacity.

I think  it depends  on what  you're trying to  achieve and  what you're
trying to avoid.

Attachment: signature.asc
Description: Digital signature


Reply to: