From owner-freebsd-hackers@freebsd.org Tue Nov 27 20:47:02 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 808B41137F64 for ; Tue, 27 Nov 2018 20:47:02 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f181.google.com (mail-it1-f181.google.com [209.85.166.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC1F16CBFD for ; Tue, 27 Nov 2018 20:47:01 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f181.google.com with SMTP id c9so753038itj.1 for ; Tue, 27 Nov 2018 12:47:01 -0800 (PST) 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:reply-to :from:date:message-id:subject:to:cc; bh=6FJONO/2hPoeJbsqTXlHBICnuSxXLwDR+CiifNgNcbg=; b=hjFDut6MMdZe1+1K2iur7WPrKBfZMTDgAQ2jryMtdQETXHtUKlhJyfp/MMrU5mdxB5 tYaDF0dnUDyN/i7CbjF3LJUSZrWAtg9rx7E3B+ExGx3IktSUl0nH3tUS1gU8ixrJmUEp TflM6CSbopPUM2/g58GDpQ1HOKFOnAFZz9mcrBopFaBb/eFzT+7AZZ+knZTpWCttSeGF nnk6848uIJnI5DSrG5FZUQ3jBmDUCDk2ytwQLkYblEg0gKwZGn+WQC8SyLWxFzcNkRuF PlDkFP4BnnynJk1nysQUzRI7B+qrF8cjhkJz+wCTHQ1/MNISJXW2ie3oTMTuIzK+5Kq7 BFVQ== X-Gm-Message-State: AA+aEWbccGyHN+BytTKbUDXcOh0CeQdrm1ru0rd0X1jCoJAwgXtGKHkd WWi4MM9AAS7Wxy0CqjFm8OQx6u1P X-Google-Smtp-Source: AFSGD/UrCpm2zmLoKHgAZTvrVWU29PdGj7MKmHp+IUqNBaJocQ6mlD3wneeOhc6DdQVE2446ghvT+g== X-Received: by 2002:a05:660c:a45:: with SMTP id j5mr434420itl.83.1543351620434; Tue, 27 Nov 2018 12:47:00 -0800 (PST) Received: from mail-io1-f45.google.com (mail-io1-f45.google.com. [209.85.166.45]) by smtp.gmail.com with ESMTPSA id d192sm1677822iog.81.2018.11.27.12.47.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Nov 2018 12:47:00 -0800 (PST) Received: by mail-io1-f45.google.com with SMTP id f6so18148634iob.1 for ; Tue, 27 Nov 2018 12:47:00 -0800 (PST) X-Received: by 2002:a5d:94cc:: with SMTP id y12mr21275969ior.233.1543351619842; Tue, 27 Nov 2018 12:46:59 -0800 (PST) MIME-Version: 1.0 References: <84f498ff-3d65-cd4e-1ff5-74c2e8f41f2e@digiware.nl> In-Reply-To: <84f498ff-3d65-cd4e-1ff5-74c2e8f41f2e@digiware.nl> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 27 Nov 2018 12:46:49 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: setting distinct core file names To: Willem Jan Withagen Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: DC1F16CBFD X-Spamd-Result: default: False [-3.96 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; IP_SCORE(-0.99)[ipnet: 209.85.128.0/17(-3.48), asn: 15169(-1.38), country: US(-0.09)]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[181.166.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[181.166.85.209.rep.mailspike.net : 127.0.0.17] 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 20:47:02 -0000 One (ugly) trick is to use multiple filesystem links to the script interpreter, where the link names distinguish the scripts. E.g., $ ln /bin/sh /libexec/my_script_one_sh $ ln /bin/sh /libexec/my_script_two_sh $ cat myscript1.sh #!/libexec/my_script_one_sh ... Cores will be dumped with %N of "my_script_one_sh." Best, Conrad On Tue, Nov 27, 2018 at 9:29 AM Willem Jan Withagen wrote: > > Hi, > > 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?? > --WjW > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"