Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 06 Feb 1998 11:31:23 -0800
From:      Julian Elischer <julian@whistle.com>
To:        "Bruce M. Walter" <walter@fortean.com>
Cc:        John Fieber <jfieber@indiana.edu>, Mike Smith <mike@smith.net.au>, hackers@FreeBSD.ORG
Subject:   Re: Powering off the system/UPS
Message-ID:  <34DB650B.33590565@whistle.com>
References:  <Pine.BSF.3.95q.980206113512.22744A-100000@callisto.fortean.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I'll add my input because I'm the original author of the 'at_shutdown()'
code.

I think adding a 3rd queue is good.
adding a priority and sorting the queues before execution is 
dubious because different authors may have used different 
ordering constants and you will only make them THINK they know 
what's going on. :)  better to have them cope with possible 
mis-ordering I think..

however, having said that, I agree that it's not a bad idea and 
however you are willing to implement it...

personally, if you MUST add priorities, then just change the existing
call and man page..
I think there are few consumers of this call at the moment.
The dpt is one, but that's checked in now so you can correct that,
and we at whistle use it, (but I can cope with it)

as long as you change the prototype (and add a comment)
most people should be ok..

still if you want to put in a new call.. feel free. :)



Bruce M. Walter wrote:
>
> 
> I'm working on reorganizing the kernel code to allow for this right now...
> Here's what I'm attempting as per Mike's suggestions:
> 
> 1) There will be another queue, tenatively called 'SHUTDOWN_PRE_HALT'
> which will run after SHUTDOWN_POST_SYNC and before an actual reboot/halt.
> 
> 2) I will add a new interface routine and support defines:
> 
> #define SHUTDOWN_PRI_MIN        1
> #define SHUTDOWN_PRI_MAX        20
> #define SHUTDOWN_PRI_DEFAULT    10
> 
> int
> pri_at_shutdown(bootlist_fn func, void *arg, int when, int priority);
> 
> which will add items to the shutdown queues with the specified priority.
> 
> at_shutdown will remain the same and will add its callouts to the queues
> at a priority of SHUTDOWN_PRI_DEFAULT.  rm_at_shutdown will also remain
> the same and will work on callouts added by either function.  Callouts
> with the same priorities will be ordered LIFO.
> 
> I'd love to hear any comments/suggestions from the peanut gallery.
> 
> - Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?34DB650B.33590565>