3

I need a little help with this.

I have a server set up at home, running Ubuntu 16.10. When I reboot, it brings up a prompt that interrupts the normal power-up sequence to notify me of case intrusion. This is normal, because I recently performed upgrades.

But I am currently away from home and cannot reboot the system without it trying to await input.

So, I would like to reboot the system without a power cycle (killing all processes and running init again?). How would I do this?

  • Is the case intrusion monitoring an Ubuntu feature or baked into your bios? If it's an Ubuntu warning and you know the service that reports it could you not disable it so it doesn't run then re-enable it on your return? – Will Mar 23 '17 at 18:43
  • Baked into my bios, there's a physical switch that gets depressed when the cover is taken off. This case intrusion reporting is done during POST, I believe. When I get home today I'll disable it. – Dev Mar 23 '17 at 18:48
  • @Will Case intrusion is typically a setting that you can control in the BIOS of the system in question. I doubt this is coming from Ubuntu. Related:superuser.com/a/409470/357362 – Elder Geek Mar 23 '17 at 18:51
  • 2
    yes it does. I need to reboot without power cycling (for example, terminating and then restarting the init process, though I don't know how) – Dev Mar 23 '17 at 18:53
  • 1
    I think it's a relevant question @ElderGeek because there might be a way to essentially restart Ubuntu without completely rebooting. That's what the QP is asking. In fact I think it's an interesting question. – Will Mar 23 '17 at 18:55
2

There are 2 possible solutions that you could try to reboot without power-cycling the system. Be aware that the 1st method may not umount drives before restarting, and you may want to script it to run after unmounting drives..

  1. Run sudo telinit u. This tells init to re-execute itself.

  2. Use kexec-reboot or kexec. They seem to accomplish the same tasks.

Check the link here for the github page.

Install kexec-tools : sudo apt-get install kexec-tools

Usage is similar for both commands;

# kexec -l /boot/vmlinuz-linux --initrd=/boot/initramfs-linux.img --reuse-cmdline
# systemctl kexec

Further (and more involved) methods are documented here.

| improve this answer | |
  • doesn't sudo telinit u just restart init and nothing else? (all processes are owned by init, so maybe that reboots? dunno, let me try it) – Dev Mar 23 '17 at 19:39
  • Yeah. – Dev Mar 23 '17 at 19:42
  • It restarts everything under init, so essentially yes. But I've only done it on a barebones remote system, which worked like a reboot without power cycling the hardware on that setup. I've never tried it on a full install but I imagine it yields the same result. – Dorian Mar 23 '17 at 19:43
  • it does not restart SSH sessions, or bash running under those sessions then? (or byobu/tmux/screen?) – Dev Mar 23 '17 at 19:44
  • my uptime is still over a week ;/ – Dev Mar 23 '17 at 19:45
1

One method may be to boot into a new kernel using kexec

apt-get install kexec-tools
dpkg-reconfigure kexec-tools

This should in theory make reboots kexec into a new kernel to do a reboot without rebooting the machine

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.