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 3E3071F5AE; Mon, 19 Jul 2021 20:49:35 +0000 (UTC) Date: Mon, 19 Jul 2021 20:49:35 +0000 From: Eric Wong To: Konstantin Ryabitsev Cc: meta@public-inbox.org Subject: Re: Restarting daemons on config file change Message-ID: <20210719204935.GA31835@dcvr> References: <20210719200318.wo4ydjonc3u3ibtu@nitro.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210719200318.wo4ydjonc3u3ibtu@nitro.local> List-Id: Konstantin Ryabitsev wrote: > Hello: > > Something I stumbled on today is the need to have the -httpd and -nntpd > daemons reread the config file after we've mirrored and initialized new > inboxdirs. The situation is: Correct, config files are read once at startup. > - public-inbox-{httpd,nntpd} are running as systemd services as user > "publicinbox" > - the mirroring and initialization/indexing is done as user "mirror", so we > can't send a HUP to the daemon processes I seem to recall HUP having some trouble with -httpd (and less so with nntpd/imapd); or at least that's what -daemon(8) manpage alludes to... I usually just swap between "@foo" and "@bar" systemd units, but I restart more often for code changes than config file changes. > 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 :>