From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2693 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dewayne Geraghty Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: s6-log can create current with 640? Date: Sat, 26 Oct 2019 12:52:39 +1100 Message-ID: <9f1c10ea-a512-438d-dd3b-4d84119394fe@heuristicsystems.com.au> References: <6f3a28f8-798c-9a55-e79b-2e54b37edf2e@heuristicsystems.com.au> <01b8c564-887f-16cf-405c-8bcfc52c02b1@heuristicsystems.com.au> <62d9001a-73bd-5cfe-4c47-f561c4dfabea@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="90572"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 To: Guillermo , Supervision Original-X-From: supervision-return-2282-gcsg-supervision=m.gmane.org@list.skarnet.org Sat Oct 26 03:54:38 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 1iOBHo-000NFx-SS for gcsg-supervision@m.gmane.org; Sat, 26 Oct 2019 03:54:38 +0200 Original-Received: (qmail 22664 invoked by uid 89); 26 Oct 2019 01:54:56 -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 22657 invoked from network); 26 Oct 2019 01:54:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=heuristicsystems.com.au; s=hsa; t=1572054762; x=1572659563; bh=2GNyX2qJ3RGsU6gUf7QO8PCOXPlfzuRuMv7nR/rfJkI=; h=Subject:To:From:Message-ID:Date; b=PIUJPSrGWaoqbRP53fXbOBq/t/pysW71EPYsg9weyxMd0Ly6cFkcPVVuwEEGNmJAN zK4/6p5neuMO3ZkkC/uYD260oLdjVQwabggB61jlVPaeszjlS0TQE66hezrZqUcmCo AbaVhfpmZcDk2pIDg5HXKeYxHpfBe9iEXX1LiqvdOMxEOg3PawinZ X-Authentication-Warning: b3.hs: Host noddy.hs [10.0.5.3] claimed to be [10.0.5.3] Openpgp: preference=signencrypt In-Reply-To: Content-Language: en-AU Xref: news.gmane.org gmane.comp.sysutils.supervision.general:2693 Archived-At: On 26/10/2019 4:06 am, Guillermo wrote: ... > Let me guess: the value of PATH is > /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin, > execline's chain loading umask is in /usr/local/bin, and FreeBSD > happens to have an 'umask' shell script in /usr/bin. If that is > correct, then you'll have to either use the absolute pathname > /usr/local/bin/umask in the execlineb chain, or run it with a PATH in > which /usr/local/bin comes before /usr/bin. > > G. > Irk! Thank-you Guillermo, your guess is correct. I'd mistakenly assumed execlineb knew where its friends were; though in hindsight its a bit much to assume that execlineb internally changes the PATH. This works correctly # rm /tmp/t1 ; setenv PATH "/usr/local/bin:/bin:/sbin:/usr/sbin:/usr/bin" ; printenv | grep -i path ; ktrace -f /tmp/t1-pathok-umaskfirst \ /usr/local/bin/execlineb -Pc 'export path "/usr/local/bin" umask 033 redirfd -w 1 /tmp/t1 echo hello' ; echo $? ; ls -l /tmp/t1 PATH=/usr/local/bin:/bin:/sbin:/usr/sbin:/usr/bin 0 -rw-r--r-- 1 root wheel 6 26 Oct 11:19 /tmp/t1 as does /usr/local/bin/execlineb -Pc '/usr/local/bin/umask 033 /usr/local/bin/redirfd -w 1 /tmp/t1 echo hello' Unfortunately it seems that the path can't be set within execlineb context. I tried both "path" and "PATH" in the following export and envfile examples. export /usr/local/bin/execlineb -Pc '/usr/local/bin/export PATH /usr/local/bin umask 033 redirfd -w 1 /tmp/t1 echo hello' ; echo $? ; ls -l /tmp/t1 rm: /tmp/t1: No such file or directory PATH=/bin:/sbin:/usr/sbin:/usr/bin 0 ls: /tmp/t1: No such file or directory envfile /usr/local/bin/execlineb -Pc '/usr/local/bin/envfile /tmp/e umask 035 redirfd -w 1 /tmp/t1 echo hello' ; echo $? ; ls -l /tmp/t1 where /tmp/e path = /usr/local/bin:/bin:/sbin:/usr/sbin:/usr/bin I've moved the various kdumps into http://www.heuristicsystems.com/s6-umask/ However I don't think there is a problem with export as /usr/local/bin/execlineb -Pc 'export T1 /tmp/t1 umask 033 importas T1v T1 redirfd -w 1 $T1v echo hello' works correctly, but envfile doesn't; might be worth a look. (?) Kind regards, Dewayne