From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2466 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Colin Booth Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: s6 problems logging Date: Sun, 27 Jan 2019 18:13:52 +0000 Message-ID: <20190127181352.nvj5rrhxvwehidk7@cathexis.xen.prgmr.com> References: <20190126221517.70ea00b8@zonker.seanm.ca> <20190127052000.4skktmkfzmit6ykl@cathexis.xen.prgmr.com> <20190127114751.169d2a15@zonker.seanm.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="15947"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: NeoMutt/20170113 (1.7.2) To: supervision@list.skarnet.org Original-X-From: supervision-return-2056-gcsg-supervision=m.gmane.org@list.skarnet.org Sun Jan 27 19:13:56 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 1gnowM-00041X-Qf for gcsg-supervision@m.gmane.org; Sun, 27 Jan 2019 19:13:54 +0100 Original-Received: (qmail 7949 invoked by uid 89); 27 Jan 2019 18:14:21 -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 7942 invoked from network); 27 Jan 2019 18:14:20 -0000 Content-Disposition: inline In-Reply-To: <20190127114751.169d2a15@zonker.seanm.ca> Xref: news.gmane.org gmane.comp.sysutils.supervision.general:2466 Archived-At: On Sun, Jan 27, 2019 at 11:47:51AM -0500, Sean MacLennan wrote: > On Sun, 27 Jan 2019 05:20:00 +0000 > Colin Booth wrote: > > > Everything looks fine from over here. Does running doorknob with -fs > > from the terminal do what you expect? > > Yup, I get a log message to the console when I send an email. > > > Also, what does > > `s6-svstat PATH_TO_DOORKNOB_SVCDIR' and > > `s6-svstat PATH_TO_DOORKNOB_SVCDIR/log' > > tell you? > > /service/doorknob# /command/s6-svstat . > up (pid 948) 47861 seconds > /service/doorknob# /command/s6-svstat log > up (pid 847) 75815 seconds > > Log has been up longer because I restarted doorknob with an s6-svc > down/up. Not sure if this is kosher with logging. Is there a > recommended way to start/stop services that have logging? > That should be fine. The only requirement that I know of is that you re-register the service directory if you add or remove a log/ dir since the presence or absence of a log/ directory is only checked when s6-svscan first checks the directory. Reregistration in this case means: delete the symlink, run s6-svscanctl -an, confirm that the removed service has exited, create the symlink, and re-run s6-svscanctl -an. Downing a logger may or may not cause problems, depending on how many messages your service sends. Not because you'll lose stuff, but because the service will block eventually as it tries to write to a pipe that isn't being drained. > > Also, does the target dir for s6-log have the files > > "current" (apparently not), "lock", and "state"? Those final two > > files are created by s6-log automatically and should at least > > indicate that it's starting up fine. > > /service/doorknob# ls log > current event lock run state supervise > > So it does have all the files/directories but current is empty even > though there should be some log entries. > Cool, that means everything can write correctly. > > I do use s6-log in one other service and it works. In the > service/s6-svscan-log I have: > > #!/command/execlineb -P > cat ./fifo > > And the same log/run as doorknob. > > Cheers, > Sean As Laurent mentioned, it sounds like your service isn't terminating its lines correctly. The other option is that you're writing your messages to stderr instead of stdout (in which case you'd end up on the catch-all logger unless you did `fdmove -c 2 1' in your doorknob script before starting doorknob itself. That said, it's unlikely, since vprintf seems to wite to stdout unless you tell it otherwise. -- Colin Booth