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 ?

To: Ian Pratt <m+Ian.Pratt@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] execve() in reboot.c ?
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <A95E2296287EAD4EB592B5DEEFCE0E9D282767@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <A95E2296287EAD4EB592B5DEEFCE0E9D282767@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Reply-to: aq <aquynh@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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