All of lore.kernel.org
 help / color / mirror / Atom feed
* execve() in reboot.c ?
@ 2005-07-25  8:53 aq
  0 siblings, 0 replies; 21+ messages in thread
From: aq @ 2005-07-25  8:53 UTC (permalink / raw)
  To: xen-devel

Hello,

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.


Should we care enough to fix this problem?


regards,
aq

^ permalink raw reply	[flat|nested] 21+ messages in thread
* RE: execve() in reboot.c ?
@ 2005-07-25 11:00 Ian Pratt
  2005-07-25 17:41 ` aq
  0 siblings, 1 reply; 21+ messages in thread
From: Ian Pratt @ 2005-07-25 11:00 UTC (permalink / raw)
  To: aq, xen-devel

 > 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 ?

Ian

^ permalink raw reply	[flat|nested] 21+ messages in thread
* RE: execve() in reboot.c ?
@ 2005-07-25 19:48 Ian Pratt
  2005-07-25 20:18 ` Sean Dague
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Ian Pratt @ 2005-07-25 19:48 UTC (permalink / raw)
  To: Rik van Riel, Vincent Hanquez; +Cc: Jeremy Katz, xen-devel, Mark Williamson

 
> > > How about simply reusing whatever signal is sent to init when 
> > > ctrl-alt-del is pressed on PCs ?
> > 
> > SIGINT
> > 
> > That's not a good idea though, if somebody put nothing in the 
> > ctrlaltdel action, then it's not going to do anything.
> 
> But isn't that exactly what we want ?   A userspace configurable
> way to trigger a system reboot.

I kind of like this approach, but it does mean that we can't distinguish
between a poweroff and a reboot. Do we care?

As I recall, the current approach was copied from one of the other Linux
architectures. 

Ian

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2005-07-26 12:55 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-25  8:53 execve() in reboot.c ? aq
  -- strict thread matches above, loose matches on Subject: below --
2005-07-25 11:00 Ian Pratt
2005-07-25 17:41 ` aq
2005-07-25 17:47   ` Mark Williamson
2005-07-25 17:56     ` Jeremy Katz
2005-07-25 18:03       ` Mark Williamson
2005-07-25 18:13         ` Rik van Riel
2005-07-25 18:20           ` Vincent Hanquez
2005-07-25 18:30             ` Anthony Liguori
2005-07-25 19:18             ` Rik van Riel
2005-07-25 18:26           ` Mark Williamson
2005-07-25 18:26         ` aq
2005-07-25 18:29           ` Mark Williamson
2005-07-25 18:31           ` Vincent Hanquez
2005-07-25 19:48 Ian Pratt
2005-07-25 20:18 ` Sean Dague
2005-07-25 20:31 ` Philip R Auld
2005-07-26 12:55   ` Gerd Knorr
2005-07-25 20:48 ` Mark Williamson
2005-07-25 20:46   ` Keir Fraser
2005-07-25 20:52   ` Rik van Riel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.