Date: Wed, 16 Nov 2011 23:55:00 -0800 From: Doug Barton <dougb@FreeBSD.org> To: Andriy Gapon <avg@FreeBSD.org> Cc: freebsd-rc@FreeBSD.org Subject: Re: KEYWORD: shutdown Message-ID: <4EC4BDD4.7010705@FreeBSD.org> In-Reply-To: <4EC3F8EC.2010005@FreeBSD.org> References: <4EC3E667.4080906@FreeBSD.org> <20111116173856.GA31200@stack.nl> <4EC3F8EC.2010005@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 11/16/2011 09:54, Andriy Gapon wrote: > on 16/11/2011 19:38 Jilles Tjoelker said the following: >> On Wed, Nov 16, 2011 at 06:35:51PM +0200, Andriy Gapon wrote: >>> I am new to all the rc stuff, so please pardon me if I am asking >>> something obvious or silly. What are the main reasons to _not_ have >>> the "shutdown" keyword in an rc script? What are the examples / >>> usages? >> >> Traditionally only very few scripts had "shutdown", leaving most of the >> cleanup to the SIGTERM and SIGKILL from init. >> >> Because it was fairly complicated to get this right (for example, a >> database server needs "shutdown" but also all programs that use it), a >> few years ago it was decided to add "shutdown" everywhere. The slower >> shutdown (a few seconds at most on machines with decent CPUs, but >> possibly rather more on slow embedded machines) was accepted. >> > > So nowadays (or "if I got to do it again") it would make more sense to have > "shutdown" as a default and add "noshutdown" for some hypothetical special cases? Not necessarily. For example, out of 151 scripts in /etc/rc.d only 52 of them use it (and I am pretty confident I added it to all scripts that start persistent services which didn't already have it). IOW, rc.d is used to do a lot of things at boot time in addition to starting daemons. In fairness most of the 800'ish rc.d scripts in ports do start a daemon, so your idea isn't totally off base, I'm just saying that what the default should be isn't as clear cut as you may think. Doug -- "We could put the whole Internet into a book." "Too practical." Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4EC4BDD4.7010705>