WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] execve() in reboot.c ?

> actually what you suggested is in use now ;-). firstly, the code use
> daemonize() to become kernel thread, then execute userspace code
> (shutdown/poweroff/halt...). if that failed (for example in case there
> is no such userspace binary), sys_reboot is called.

Yeah, I just looked at the code and realised I was just spouting rubbish 
earlier :-)

> i dont see why we try to call userspace comand first, then fail thru
> to sys_reboot(). why just call sys_reboot()?

As Jeremy said, the reboot command does rather more than just call sys_reboot.  
The sys_reboot call means "really reboot now", without doing the nice things 
init does (unmounting filesystems, stopping processes politely, etc).

I think there must be another way of achieving this effect without exec-ing 
things, though.

Cheers,
Mark

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel