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 ?

Can't we just fire off a kernel thread to call sys_reboot and friends 
directly?  It seems unfortunate to have to rely on userspace applications, 
having gone to the trouble of handling the cmsg in the kernel.

Cheers,
Mark

On Monday 25 July 2005 18:41, aq wrote:
> On 7/25/05, Ian Pratt <m+Ian.Pratt@xxxxxxxxxxxx> wrote:
> >  > Domain kernel has arch/xen/kernel/reboot.c, which executes
> > >
> > > shutdown and halt on request. But one problem is that we have
> > > the path and command options fixed in the kernel, like this:
> > >
> > >
> > >     static char *restart_argv[]  = { "/sbin/shutdown", "-r",
> > > "now", NULL };
> > >     static char *poweroff_argv[] = { "/sbin/halt",     "-p",
> > >       NULL };
> > >
> > >
> > > That is kind of violating the rule: kernel should never
> > > enforce the policy to the user. We can see the problem if for
> > > example domU uses busybox instead of sysvinit: busybox doesnt
> > > support "halt -p", so "xm shutdown" cannot shutdown the domU.
> >
> > Would 'telinit 1' / 'telinit 6' work on busybox ?
>
> Unfortunately telinit is not available in busybox.
>
> Here are 2 patches (for -testing and -unstable), in which i replaced
> shutdown and halt with poweroff and reboot, and executes those without
> any options. This patch confirms to work with both sysvinit (on
> Ubuntu) and busybox (ttylinux - without these patch i couldnt shutdown
> ttylinux with "xm shutdown"). Please apply.
>
>
> Signed-off-by: Nguyen Anh Quynh <aquynh@xxxxxxxxx>
>
>
> $ diffstat shutdown.testing.patch
>  reboot.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
>
> $ diffstat shutdown.unstable.patch
>  reboot.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)

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