From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id AA9E71F5AE; Tue, 20 Jul 2021 21:07:24 +0000 (UTC) Date: Tue, 20 Jul 2021 21:07:24 +0000 From: Eric Wong To: Konstantin Ryabitsev Cc: meta@public-inbox.org Subject: Re: Restarting daemons on config file change Message-ID: <20210720210724.GA25323@dcvr> References: <20210719200318.wo4ydjonc3u3ibtu@nitro.local> <20210719204935.GA31835@dcvr> <20210720170019.p5d23tjb4v2mrekn@nitro.local> <20210720203433.GA28287@dcvr> <20210720204925.7xkk6ktihohxnfo3@nitro.local> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210720204925.7xkk6ktihohxnfo3@nitro.local> List-Id: Konstantin Ryabitsev wrote: > On Tue, Jul 20, 2021 at 08:34:33PM +0000, Eric Wong wrote: > > > Okay, let me see what I can come up with. Looks like the best course of action > > > is to: > > > > > > 1. use a global blocking lock > > > 2. copy the config file to a new location > > > 3. make the necessary changes to the temporary config file > > > 4. move the temp config file to overwrite the current config > > > 5. release the lock > > > > public-inbox-init already does all of that. It doesn't set > > all possible keys, yet (e.g. infourl, maybe some others). > > I figured as much, but we do want to set extra keys *and* write the config in > a certain order (e.g. prioritizing some sources over others by listing them > first). I currently do this via a list-id globbing match (e.g. > --listid-priority=*.linux.dev,*.kernel.org,*). Ah, that gets tricky, since git-config doesn't seem to provide a mechanism for ordering. Not sure, perhaps serializing -init invocations somehow is the way to go? I'm not sure how to expose that ordering, though... > Apropos, question -- will public-inbox-init do anything to the config file if > it finds that all the settings are already in place, or will it just accept > them? It only checks conflicting addresses, at the moment.