From owner-freebsd-hackers Fri Aug 18 0:52:50 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from hand.dotat.at (sfo-gw.covalent.net [207.44.198.62]) by hub.freebsd.org (Postfix) with ESMTP id A13F637B43F for ; Fri, 18 Aug 2000 00:52:47 -0700 (PDT) Received: from fanf by hand.dotat.at with local (Exim 3.15 #3) id 13Pgwr-0000V2-00; Fri, 18 Aug 2000 07:52:17 +0000 Date: Fri, 18 Aug 2000 07:52:17 +0000 From: Tony Finch To: Karl Pielorz Cc: Warner Losh , hackers@FreeBSD.ORG Subject: Re: Critical (or equivalent) section in Userland? Message-ID: <20000818075217.B683@hand.dotat.at> References: <399BA212.A84240AE@tdx.co.uk> <200008171723.LAA12924@harmony.village.org> <399C5201.5B6911CE@tdx.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <399C5201.5B6911CE@tdx.co.uk> Organization: Covalent Technologies, Inc Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Karl Pielorz wrote: > >I don't think advisory locks will work - the other process is sendmail... I >have to keep it from opening any of it's config files, whilst I 'rename' out >of place the old ones (keeping any fd's to them intact) and rename in the new >ones... Why not append a serial number to the end of the filenames of the subsidiary configuration files, and modify sendmail.cf accordingly? Then the update procedure could be: (1) write all the new files as $filename.`date +%Y%d%m%H%M%S` (2) mv sendmail.cf.date sendmail.cf (or use `ln -sf` if you want to keep old files) (3) every day or so delete configuration files that are older than your maximum queue run time. This gives you atomic configuration updates. You don't need to rename the old sendmail.cf to another because existing fds will remain attached to the old file which isn't being altered, just unlinked. Tony. -- en oeccget g mtcaa f.a.n.finch v spdlkishrhtewe y dot@dotat.at eatp o v eiti i d. fanf@covalent.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message