Date: Fri, 18 Aug 2000 07:52:17 +0000 From: Tony Finch <dot@dotat.at> To: Karl Pielorz <kpielorz@tdx.co.uk> Cc: Warner Losh <imp@village.org>, hackers@FreeBSD.ORG Subject: Re: Critical (or equivalent) section in Userland? Message-ID: <20000818075217.B683@hand.dotat.at> In-Reply-To: <399C5201.5B6911CE@tdx.co.uk> References: <399BA212.A84240AE@tdx.co.uk> <200008171723.LAA12924@harmony.village.org> <399C5201.5B6911CE@tdx.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
Karl Pielorz <kpielorz@tdx.co.uk> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000818075217.B683>