From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2573 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dewayne Geraghty Newsgroups: gmane.comp.sysutils.supervision.general Subject: s6-log problem with +regex Date: Fri, 10 May 2019 11:02:17 +1000 Message-ID: <1fd4f712-f743-68ff-f648-151004ecfb0b@heuristicsystems.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="1052"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 To: supervision@list.skarnet.org Original-X-From: supervision-return-2163-gcsg-supervision=m.gmane.org@list.skarnet.org Fri May 10 03:03:58 2019 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.89) (envelope-from ) id 1hOtx7-00006n-KG for gcsg-supervision@m.gmane.org; Fri, 10 May 2019 03:03:58 +0200 Original-Received: (qmail 1243 invoked by uid 89); 10 May 2019 01:04:19 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Original-Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Original-Received: (qmail 1236 invoked from network); 10 May 2019 01:04:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=heuristicsystems.com.au; s=hsa; t=1557450137; x=1558054938; bh=0dMkBDlHWs2mmADqPo30nnMoxZnYsjNXK9aQkfeiuFg=; h=To:From:Subject:Message-ID:Date; b=X3T0LBH1xIEefps3M0GnPHkNA1HA/JvZYuotleOPUwVmAAuta16Hk7Py0PGRuXeBL E7+Bb/eFqcjFw75hcmMpAcTY+/xnl2HMZCdz7gMmueC/M0rv/D8SoCznqLeYxbstlg O3BHYp1s8JPwrOYCbEOGE+nL41UtSOikTGAvy9CR5YKn4tJ6qxpTn X-Authentication-Warning: b3.hs: Host noddy.hs [10.0.5.3] claimed to be [10.0.5.3] Openpgp: preference=signencrypt Content-Language: en-AU Xref: news.gmane.org gmane.comp.sysutils.supervision.general:2573 Archived-At: Thank-you for s6-rc and friends. I came across two items: 1. the s6-log in testing requires a control directive. In my testing without a T, t, n $VALUE for example, the s6-log command failed. 2. The regular expression preceded by a + unintentionally matches everything, which was surprising as I intended to maintain separate logs which emanated from the same process (apache24) So to testing. My test comprised an input /tmp/af with the intention of four separate s6-log managed logdirs. The logdirs' structure was correctly created, however three contained the same content, and the default contained nothing. So the reduced form of testing looks like this: # cat /tmp/af # a file of text to be processed a line of text not selected b nother line of text c more lines [date] with line of text The intention is to create a separate log based on a regex of the first character. Unfortunately the selection mechanism failed and the entire content of the test file (/tmp/af) was duplicated, ie unselectively. The following places the content of /tmp/af into /tmp/date-only. #!/usr/local/bin/execlineb -P ; # The testing script redirfd -r 0 /tmp/af /usr/local/bin/s6-log -b n3 +^\\\[ /tmp/date-only f s100 S1500 T /tmp/default The following works correctly, in that date-only does not contain the [date] line. It does contain the rest of /tmp/af, while /tmp/default does contain only the date (input line). # cat s6-test.sh #!/usr/local/bin/execlineb -P redirfd -r 0 /tmp/af /usr/local/bin/s6-log -b n3 -^\\\[ /tmp/date-only f s100 S1500 T /tmp/default Incidentally using the s6-log command /usr/local/bin/s6-log -b n3 +^\\\[ /tmp/date-only s10 S150 T +^b /tmp/b-only f s100 S1500 T /tmp/default results in both /tmp/date-only/current and /tmp/b-only/current containing all of /tmp/af, /tmp/default had the expected structure but empty current file. The platform is amd64 FreeBSD 11.2Stable built May 6, clang v7.0.0 and clang 8.0.0 PS I haven't made sense of the hyphen in the example, after "E500 - " on page https://www.skarnet.org/software/s6/s6-log.html. Testing resulted in s6-log: fatal: unrecognized directive: -