Restart Linux System

Sander Steffann s.steffann at computel.nl
Tue May 22 13:10:51 EDT 2007


Hi,

> > Probably not.  You need to just spawn the "reboot" command, or run
> > "init 6."  This requires root, though.  Without root there's no way
> > to reboot a linux system.
> 
> ...unless you run shutdown(8) or reboot(8) setuid root (reboot is
> kinda harsh though, btw).

It's not that bad. Reboot takes care of unintended consequences itself:

from 'man 8 reboot':
> If halt or reboot is called when the system is not in runlevel 0 or 6,
> in other words when it's  running  normally, shutdown will be invoked
> instead (with the -h or -r flag).

Since version 2.74 :)
- Sander






More information about the Python-list mailing list