From mboxrd@z Thu Jan 1 00:00:00 1970 From: aq Subject: Re: execve() in reboot.c ? Date: Tue, 26 Jul 2005 03:26:34 +0900 Message-ID: <9cde8bff0507251126303ec116@mail.gmail.com> References: <200507251847.56337.mark.williamson@cl.cam.ac.uk> <1122314192.2608.20.camel@bree.local.net> <200507251903.59053.mark.williamson@cl.cam.ac.uk> Reply-To: aq Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <200507251903.59053.mark.williamson@cl.cam.ac.uk> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Mark Williamson Cc: Jeremy Katz , xen-devel@lists.xensource.com, Ian Pratt List-Id: xen-devel@lists.xenproject.org On 7/26/05, Mark Williamson wrote: > > > 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. > > > > That doesn't do a graceful shutdown of running processes, does it? >=20 > Hmmmm, I suppose not. Ah well, I think I'll withdraw my previous stateme= nt as > I can't think of another way to do this right now :-) >=20 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. i dont see why we try to call userspace comand first, then fail thru to sys_reboot(). why just call sys_reboot()? regards, aq