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: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 07E661F9E5 for ; Tue, 20 Jul 2021 17:00:23 +0000 (UTC) Received: by mail-qk1-x734.google.com with SMTP id j184so20674845qkd.6 for ; Tue, 20 Jul 2021 10:00:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=vmr1svT5l2Ho8lazGUrH0YiVXSPsvArMkD4KoBNN2rc=; b=PZGqKss49BJcNL/sdtQBGKHJeiKaVnkXNxaTwIqSnTgN76L88fwBu51pK+pXtysPnY FYwr8MKGL8FM1jGVQ/8cofyX6WGHmL/m0kNS7u7ybAY7hUAYkRZJXH+3FrMA4Eb5Yu6M eEG/+P7pGBv7JGJ/hs7YzVjJnoIJrdnvXmXiQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vmr1svT5l2Ho8lazGUrH0YiVXSPsvArMkD4KoBNN2rc=; b=Nwv5oTzZ/CanQF23f6ErBWZ59446h0mSP7wo6ad5aQsieJvRtP+ewqcrjXRapee/xa 4g1s5cgrCibVS0PMyB71beZ/H6hBeYmR7HJ5/1XXsrKozGPcwqObZLgYnPaC8AkweVqt zCDBlGPRV/u11YtQXiDFzhd823LUo5aYnvRDX2wGT/EFwWhx/vsmdMG2xtuYTUaMpxUq K4MqRJ3KFveDc28iHr04Mep6ooiCa7JLo3ome29YzMIzN1aPqX4/oC/DTyWD6GXxMiPu Xz+GIgtGXbxi9L19Aep1ORv/n7Eic+Y9Wt897eomyxjFWg7WvFo2EqRMFuICZe/Uf/GX NEOQ== X-Gm-Message-State: AOAM533yOCa3V3hfScvQZmly2abz6Eyhwus/KBhFF2zy/muV9j9g8cg+ y2cO3SagAPAyFiRnr3At6leB5Q== X-Google-Smtp-Source: ABdhPJy10XPt02jidPYe02sydUMT9dEufgQjELTKtSgdfN1y0I1bRAaxAITuzNFJCb7zi7SQBc+A6w== X-Received: by 2002:a37:9d12:: with SMTP id g18mr7337606qke.457.1626800421984; Tue, 20 Jul 2021 10:00:21 -0700 (PDT) Received: from nitro.local ([89.36.78.230]) by smtp.gmail.com with ESMTPSA id r2sm9751732qkf.94.2021.07.20.10.00.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jul 2021 10:00:21 -0700 (PDT) Date: Tue, 20 Jul 2021 13:00:19 -0400 From: Konstantin Ryabitsev To: Eric Wong Cc: meta@public-inbox.org Subject: Re: Restarting daemons on config file change Message-ID: <20210720170019.p5d23tjb4v2mrekn@nitro.local> References: <20210719200318.wo4ydjonc3u3ibtu@nitro.local> <20210719204935.GA31835@dcvr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210719204935.GA31835@dcvr> List-Id: On Mon, Jul 19, 2021 at 08:49:35PM +0000, Eric Wong wrote: > > The best I can think of is a systemd watcher service that automatically > > restarts the daemons when the config file is modified, but I wanted to check > > here first to see if perhaps I'm missing something simpler. > > Yes, a systemd.path unit might be the way to go. A patch for > examples/ would be appreciated if you go down that route :> 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 This would make sure that there is are no races and that all changes show up at once and don't repeatedly trigger the path watcher. -K