From owner-freebsd-hackers@freebsd.org Tue Nov 27 18:37:41 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E32841157B01 for ; Tue, 27 Nov 2018 18:37:40 +0000 (UTC) (envelope-from freebsd-lists@be-well.ilk.org) Received: from be-well.ilk.org (be-well.ilk.org [23.30.133.173]) by mx1.freebsd.org (Postfix) with ESMTP id 669608CB7A for ; Tue, 27 Nov 2018 18:37:40 +0000 (UTC) (envelope-from freebsd-lists@be-well.ilk.org) Received: by be-well.ilk.org (Postfix, from userid 1147) id C6A2E33C1E; Tue, 27 Nov 2018 13:31:04 -0500 (EST) From: Lowell Gilbert To: Willem Jan Withagen Cc: FreeBSD Hackers Subject: Re: setting distinct core file names References: <84f498ff-3d65-cd4e-1ff5-74c2e8f41f2e@digiware.nl> Reply-To: FreeBSD Hackers Date: Tue, 27 Nov 2018 13:31:04 -0500 In-Reply-To: <84f498ff-3d65-cd4e-1ff5-74c2e8f41f2e@digiware.nl> (Willem Jan Withagen's message of "Tue, 27 Nov 2018 18:27:59 +0100") Message-ID: <44efb6mkyf.fsf@be-well.ilk.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Queue-Id: 669608CB7A X-Spamd-Result: default: False [-0.97 / 15.00]; HAS_REPLYTO(0.00)[freebsd-hackers@freebsd.org]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: be-well.ilk.org]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.56)[-0.561,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-0.19)[ip: (0.08), ipnet: 23.30.0.0/15(0.04), asn: 7922(-0.99), country: US(-0.09)]; ASN(0.00)[asn:7922, ipnet:23.30.0.0/15, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.48)[-0.480,0]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.73)[-0.728,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[ilk.org]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2018 18:37:41 -0000 Willem Jan Withagen writes: > Looking at core(5) and sysctl it looks like these are system wide > settings.... > > Is there a possibility that a program can set its own corefile name > (and path?) > > During parallel testing I'm running into these scripts that generate > cores, but they end up all in the same location. But it would be nice > if I could one way or another determine which file came from what > script. > > But for that I would need to be able to set something like > %N."script".core > as the core name. I could then put that in then ENV of the script and > the program would pick it up and set its own corefile name. > > Possible?? If you can run the scripts in arbitrary paths, you can encode any extra information you need in a directory name. [I'd recommend just changing the process name, but I'm guessing that the cores themselves are being generated by something running in a subshell.]