From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2426 Path: news.gmane.org!.POSTED!not-for-mail From: Guillermo Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: Log rotation issue with runit Date: Sat, 29 Dec 2018 19:32:33 -0300 Message-ID: References: <20181226015822.GH29946@home.lan> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1546122639 27530 195.159.176.226 (29 Dec 2018 22:30:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 29 Dec 2018 22:30:39 +0000 (UTC) Cc: 916230-quiet@bugs.debian.org To: Supervision Original-X-From: supervision-return-2016-gcsg-supervision=m.gmane.org@list.skarnet.org Sat Dec 29 23:30:35 2018 Return-path: Envelope-to: gcsg-supervision@m.gmane.org Original-Received: from alyss.skarnet.org ([95.142.172.232]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1gdN7p-00071O-UJ for gcsg-supervision@m.gmane.org; Sat, 29 Dec 2018 23:30:34 +0100 Original-Received: (qmail 3563 invoked by uid 89); 29 Dec 2018 22:33:11 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Original-Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 3556 invoked from network); 29 Dec 2018 22:33:10 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=kaiEMyVeHD4MOUiNSRp9LrWSsVXSw3MkYEjPiSi7oSo=; b=JJ9Dqj03hWOldz4IkN74DK5sma/C6SYilm089E1u8kIb15HqkTmEALlm9IDQx5kXXD HzBPOMcXEQA8NYJHAtFC6amspoKxW8C9H58+kc+mWlEqRmQ2eF6kbZIOJNVxsaZUsDF3 q5P5d8UsaB5alkPRBWkTL+fjtG2RyrlkgFmAI1ON479dyNSV1HNObvdQpQAWHX6DXXlm 5pm64eK6r/yZMVXbJqK1QJIEHqRtn787lySUeGRpt0/OSmvhqoQ+HXwG7JukaTJ5dfqp B9cyMCymT1FOwmGzmXM2WOqbud7D2UMhs31e3CO6rPJH4ATIsVmMbsyqiU7PrMZjp7MH +F5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=kaiEMyVeHD4MOUiNSRp9LrWSsVXSw3MkYEjPiSi7oSo=; b=ayUaY/iyHcIy48BvMcgRjadgNQOVvttYASaO5KFT486RF1z3Hx5BRzdsZp6X5AlZc1 aHYbCJpou21uyErIsMvHoww/h/ddD1CWjiL789m07XUb3se7iJkOUTnaGL/DI5BJTYWn T+YBnCoEKhJP6OPEYaYImI9w59kjVanRhl4L/Ln/LmxDFGGnSkIU1mG6uDg/vdCQM0y5 73Nq4uJ6TP5wgPJs4jDC3fDnpUIo7Aa//uAnrmqmwffzKiNID1Jkw2p1mU6gZAxPrH+Q G5sOcyX8SUjVVT04weGj2WMtcU2Um2JUd3ZlXKF+lEzeK9oVMMfXGxLSQlgf6cuCvnUm uuMA== X-Gm-Message-State: AA+aEWYsezvAk3ThennLKchEeg9+fYLFhIEJAEX/99M9e5AHvbNtZZnG fxmPSrs62ZByAS5Zs/bATOGU/15jHFlPwKuOOwQFFw== X-Google-Smtp-Source: ALg8bN6XRRoT9oCV305brvKO1dUSpNQP2IMeCDKoAHRDJjnKErePFJddsoZ8fGXp7mFJi1e3qhSSk6ODqb0l0SpGKyc= X-Received: by 2002:a05:660c:4c5:: with SMTP id v5mr21919267itk.104.1546122762744; Sat, 29 Dec 2018 14:32:42 -0800 (PST) In-Reply-To: Xref: news.gmane.org gmane.comp.sysutils.supervision.general:2426 Archived-At: El s=C3=A1b., 29 dic. 2018 a las 15:33, Dmitry Bogatov escribi=C3=B3: > > > > And this issue happens not only on crash, it happens after every > > > termination of svlogd, due any signal. I would agree that SIGKILL is > > > crash, but issue reproduces with SIGINT and SIGTERM. > > > > SIGTERM should make svlogd exit cleanly, are you sure? It does for me, > > and when restarted, does not create any .u file (using Gentoo's runit, > > which is upstream runit plus a minor patch to the makefile). > > Wierd. I tried again, and failed to reproduced issue with SIGTERM this > time. Good. This is the expected behaviour of SIGTERM. > What do you mean, `supervision tree not not being teared down properly'? First of all, I should have written "not being torn down properly" :P With "properly" I mean with all runsv and runsvdir processes exiting cleanly. Either by sending runsvdir a SIGHUP signal, which makes it take care of its runsv children, of by sending runsvdir a SIGTERM signal and then making all runsv processes exit one by one with 'sv exit' (or SIGTERM, which is equivalent). Each runsv will then close the writing end of the logger's pipe before exiting, if there is one, making the logger finalize the 'current' file, set its permissions to 0744, and exit as well (because it detects EOF in its stdin). So next time svlogd is started, no .u file. I know this to work as described on Gentoo. If runit is the init system, process 1 sends a SIGTERM signal to the runsvdir process that /etc/runit/2 replaces itself with during the shutdown sequence, so it is the task of /etc/runit/3 to make supervised processes exit, as well as their runsv supervisors. Debian's runit-2.1.2-19 'stock' /etc/runit/3 file is this one, right? * https://salsa.debian.org/runit-team/runit/raw/a45cb0000c4ec73e1e293d37214= 7ad5ab3f1d2a9/debian/contrib/3 Here, the 'sv exit /etc/service/*' that follows 'sv force-stop /etc/service/*' takes care of making the runsv processes exit. The bug reporter's /etc/runit/3 is a modified one, so that's what I would look next. G.