All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Vlasenko <vda@ilport.com.ua>
To: Greg Howard <ghoward@sgi.com>
Cc: Christoph Hellwig <hch@lst.de>,
	davem@davemloft.net, LKML <linux-kernel@vger.kernel.org>,
	Aaron Young <ayoung@sgi.com>
Subject: Re: [PATCH, RFC] Standardize shutdown of the system from enviroment control modules
Date: Sat, 27 Aug 2005 16:16:21 +0300	[thread overview]
Message-ID: <200508271616.21847.vda@ilport.com.ua> (raw)
In-Reply-To: <Pine.SGI.4.58.0508260719050.46392@gallifrey.americas.sgi.com>

> > > > Currently snsc_event for Altix systems sends SIGPWR to init (and
> > > > abuses tasklist_lock..) while the sbus drivers call execve for
> > > > /sbin/shutdown (which is also ugly, it should at least use
> > > > call_usermodehelper) With normal sysvinit both will end up the same,
> > > > but I suspect the shutdown variant, maybe with a sysctl to chose the
> > > > exact path to call would be cleaner.  What do you guys think about

sysctl is indeed would be nice. Paranoid users may insist on having
freedom not to have /sbin at all.

> > > > adding a common function to do this.  Could you test such a patch for
> > > > me?
> > >
> > > Okay, here's such a patch, I've also switched the SN and the two sbus
> > > drivers over.
> >
> > ping?
>
> Hi Christoph,
>
> Got your patch and built it into a kernel...  Ran into other
> (unrelated) difficulties booting said kernel...  I'll see if I
> can get that sorted out today and test drive it.
>
> From inspection I don't see any problem with the patch.
>
> Thanks - Greg

[snip]

> > > +/*
> > > + * envctrl_do_shutdown  -  shut the system down when overheating
> > > + *
> > > + * Common routine to be called from all enviromental monitoring
> > > + * drivers when a fatal overheating is detected.
> > > + *
> > > + * Returns 0 if /sbin/shutdown has been called sucessfully, 1 if
> > > + * this routine has been called already but the kernel is still
> > > + * running or a negative error value if executing the shutdown
> > > + * command failed.
> > > + */
> > > +int envctrl_do_shutdown(void)
> > > +{
> > > +	static int shutting_down = 0;
> > > +	int error;
> > > +
> > > +	if (shutting_down)
> > > +		return 1;
> > > +	shutting_down = 1;
> > > +
> > > +	printk(KERN_CRIT "envctrl: WARNING: Shutting down the system now.\n");
> > > +	error = call_usermodehelper("/sbin/shutdown", argv, envp, 0);
> > > +	if (error) 
> > > +		printk(KERN_CRIT "envctrl: WARNING: system shutdown failed!\n");
> > > +	return error;
> > > +}
--
vda

      reply	other threads:[~2005-08-27 13:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-09 21:10 Standardize shutdown of the system from enviroment control modules Christoph Hellwig
2005-08-09 21:25 ` Greg Howard
2005-08-09 21:36   ` Standardize shutdown of the system from enviroment control Aaron Young
2005-08-11 12:10 ` Standardize shutdown of the system from enviroment control modules Pavel Machek
2005-08-11 17:37 ` [PATCH, RFC] " Christoph Hellwig
2005-08-26 11:44   ` Christoph Hellwig
2005-08-26 12:22     ` Greg Howard
2005-08-27 13:16       ` Denis Vlasenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200508271616.21847.vda@ilport.com.ua \
    --to=vda@ilport.com.ua \
    --cc=ayoung@sgi.com \
    --cc=davem@davemloft.net \
    --cc=ghoward@sgi.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.