From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16918 invoked from network); 5 Sep 2020 20:50:07 -0000 Received: from alyss.skarnet.org (95.142.172.232) by inbox.vuxu.org with ESMTPUTF8; 5 Sep 2020 20:50:07 -0000 Received: (qmail 5853 invoked by uid 89); 5 Sep 2020 20:50:33 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Received: (qmail 5846 invoked from network); 5 Sep 2020 20:50:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=Q wUZOBmYEdkESHRmeAK9NjFvPNcLuO2om7vYAX9cwjk=; b=It8Be2Zc7Svj0B6IY wuVuskZ4lGLCP69MbelHQoh92s08tOcnxyg7KYsnmmnoJBLMAWkqqgzGcZi2CT9L DEZcKoR4WVXKLj2XkRzy35SKOFvJKK4XrE2rFfkQcwUXKfxU2LDXKJ1yW0D88DRr +x12LxyZkuAWOck0ZwOQ5ZOSeg+IZ4uqnUUiv0hwMQFPOtvlJf8mY+OPhsY8X0ST l00DRU/fEGHqv4whciEoLwrIH6yU5qXj0Ja3D98OQKcpvrXEQ0e3WYN8uV12JjZ2 aUrUqmsenNb5mWemtZ3SrWDQoe2qEdPq1YTmkU7V+7FXfoR5C0uhomLsRm94Qh70 EsdHQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=QwUZOBmYEdkESHRmeAK9NjFvPNcLuO2om7vYAX9cw jk=; b=mkUpzAFUrr+BZDxiS6gJ12RDRtj+b8/UKElHhkv/u7IPCDdW8g8ZFDz8X zDWpMA8ZzzEg5jdiEMkurals+CdvUcLMYQk4/DU7ygozNyEYaWTMWgIe5hZ8D13k RbCawzxLKWHtv9Gj697plrpw9MsMqFADwJ056JTnRNZIGgluYQii/IVhbSLGiOE9 NmZcqWDxw6BixV4xDVa5rRtExs9L1VxEWs1tqm3RHNDOUW25bA+oDcve1clNYDYt 5LSMUBg2E7UkxGyY9UMoum/KPIlzmlZIHUoJzJ0mZgFzLyUHLtwitSu+E7cHImlx dGn4pmqx5ppzmhD6X4Nh/lGA3jnOg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudeghedgudehfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesth ejredttdefjeenucfhrhhomhepufgrmhhuvghlucfjohhllhgrnhguuceoshgrmhhuvghl sehshhholhhlrghnugdrohhrgheqnecuggftrfgrthhtvghrnhepteetffejfefhgedtud eluddtgeduffeludeufedtvdelgfeiffevfefhudekgedvnecuffhomhgrihhnpehgihht hhhusgdrtghomhenucfkphepjedtrddufeehrddugeekrdduhedunecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhl rghnugdrohhrgh X-ME-Proxy: Subject: Re: Update early logger logging path after remounting root as rw To: Rio Liu , supervision@list.skarnet.org References: From: Samuel Holland Message-ID: <408ccc80-aa66-66cb-12ae-f29e6aba6cc7@sholland.org> Date: Sat, 5 Sep 2020 15:50:03 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 9/5/20 3:26 PM, Rio Liu wrote: >> >> Well the catch-all logger is supposed to be just that: a catch-all >> logger. That means that ideally, every service should have its own >> dedicated logger, typically writing to /var/log/something, and the >> catch-all logger is only used for exceptional stuff such as error >> messages from the supervision tree, so it doesn't matter that its logs >> are stored under /run. >> > So the best practice is that every (long run) services should have a > "producer-for" and an extra "service-log" service? Sounds like a lot of > repeating works... perhaps I can use some symblink to do that. Yes, or you can preprocess your service directories. For example, the script I use looks for a "logdir" file containing the log directory path, and uses it to generate the pipeline and logger service: https://github.com/smaeul/rc/blob/113e9623/update#L48 >> It's difficult to do. It's possible in theory: you could have a oneshot >> that modifies /run/service/s6-svscan-log/run, replacing the >> "/run/uncaught-logs" string with the new location you want, then >> copies /run/uncaught-logs into that new location and restarting the >> s6-svscan-log service. >> > > Yeah I don't think I'll go that route. Maybe it'll be easier to somehow > mount root as rw before the logger starts (if it's actually easier), or > just boot with rw root if I really need those logs to be saved. There are a couple of other options I can think of: 1) Bring up a second service reading from the same /run/service/s6-svscan-log/fifo pipe, and once the new logger is ready, bring down the old s6-svscan-log service (from a oneshot depending on the new logger). During the transition, log lines could go to either service, but nothing would be lost. 2) Keep logging to /run/uncaught-logs, but also copy the logs to /var in a way that doesn't interfere with the s6-svscan-log service. This could be running `tail -f` on /run/uncaught-logs/current, or periodically `rsync`ing the whole directory to /var.