supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Dewayne Geraghty <dewayne.geraghty@heuristicsystems.com.au>
To: Guillermo <gdiazhartusch@gmail.com>,
	Supervision <supervision@list.skarnet.org>
Subject: Re: s6-log can create current with 640?
Date: Sat, 26 Oct 2019 12:52:39 +1100	[thread overview]
Message-ID: <9f1c10ea-a512-438d-dd3b-4d84119394fe@heuristicsystems.com.au> (raw)
In-Reply-To: <CADQ2Nw9oYoCauQbvDa=N7G53tgTKKWDLoQUV-OxVE41kPM7iOg@mail.gmail.com>

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



  reply	other threads:[~2019-10-26  1:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23  2:27 Dewayne Geraghty
2019-10-23  4:53 ` Colin Booth
2019-10-23  5:39   ` Dewayne Geraghty
2019-10-23  7:15 ` Jonathan de Boyne Pollard
2019-10-23 23:03   ` Dewayne Geraghty
2019-10-23 23:58     ` Laurent Bercot
2019-10-25  8:20       ` Dewayne Geraghty
2019-10-25 17:06         ` Guillermo
2019-10-26  1:52           ` Dewayne Geraghty [this message]
2019-10-26  5:27             ` Laurent Bercot
2019-10-26  7:16               ` Dewayne Geraghty
2019-10-26 13:08                 ` Laurent Bercot
2019-10-29  7:28               ` Jonathan de Boyne Pollard
     [not found]               ` <a8fbd02e-0265-3d59-89d1-81048665693c@ntlworld.com>
2019-10-29  8:53                 ` Laurent Bercot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9f1c10ea-a512-438d-dd3b-4d84119394fe@heuristicsystems.com.au \
    --to=dewayne.geraghty@heuristicsystems.com.au \
    --cc=gdiazhartusch@gmail.com \
    --cc=supervision@list.skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).