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

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


  • To: Ian Pratt <m+Ian.Pratt@xxxxxxxxxxxx>
  • From: aq <aquynh@xxxxxxxxx>
  • Date: Tue, 26 Jul 2005 02:41:31 +0900
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 25 Jul 2005 17:40:03 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=JJ5665wM0/WzrQDH4Lygp3YwE2Tf3R2y0JMdUYVpz6742WmGc3t+zFEQ/QrlaXxg9KNlT8KpK5rQzctWBLg9VYr/NVNP91B7RW6P24M3YT2JjtD9xw3q9PoYRBq7OEvqPjAQ4mP05k3Avoe3Sv2Tcm7OVEa3VFkRQUv8zj1auvM=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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(-)

Attachment: shutdown.unstable.patch
Description: Binary data

Attachment: shutdown.testing.patch
Description: Binary data

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.