Re: rebooting from %pre

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

 



Since we're collecting %pre reboot entries, here's one
where I brought in the reboot binary:

http://www.cpqlinux.com/ks-pre-reboot.html

I don't think this does much cleanup either, but being a
binary, you can call it via SSH (in my %pre I currently
add ntpdate, sshd, /dev/vcs, and reboot).

--RB

Jason Kohles wrote:

Digging through the archives I found several people who had tried the same
thing I was trying to do (reboot from %pre), but nobody who had made it work,
so I submit for the archives my solution, to save future searchers from the
hassle...

#include <sys/reboot.h>

int main(int argc, char **argv) {
   reboot(RB_AUTOBOOT);
}

This thing doesn't sync your disks or kill your processes or anything nice
like that, it's the digital equivalent of an ice pick through the brain, so
be careful if you intend to use it in an environment where the data on the
disks matters...






[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux