Re: Documentation feedback: surprising behavior of null substitutes

2016-05-20 Thread Max Ivanov
To me new docs make it much clearer now what effect "no word" can
have, but once you learned something it is hard to say whether it
fully explains the behavior and warns about pitfall well enough so
that next newcomer will not have a problem with it.

On 20 May 2016 at 17:18, Laurent Bercot  wrote:
> On 20/05/2016 18:09, Max Ivanov wrote:
>>
>> so it uses "zero word" and "null word" interchangeably, which doesn't
>> help either :) "zero word" seems closer to "empty word" (==no
>> magic,just ''), than to "null word" (magic)
>
>
>  Changed the importas.html file. Is the current wording (no pun intended)
> clear enough?
>
> --
>  Laurent


Re: backtick to NOT set variable

2016-05-20 Thread Laurent Bercot

On 18/05/2016 13:42, Max Ivanov wrote:

can backtick (or combination of other scripts commands) can be  to NOT
set env var on error?


 I'm pretty sure that any case can be achieved with the current behaviour,
but I agree that ugly contorsions are necessary for more than one case,
so I'm ok to add an option switch - but the semantics need to be right
(and it won't be -z, which I prefer to only use for something related to
reaping z-ombies)

 What exactly is the behaviour you want:

 - don't exit on error, just keep exec'ing
   + do you just define "error" as the subprocess exiting anything else
than 0 ?
 - but completely undefine the variable, in order for later tests such
as importas to pick that up?

 Is that right, or have I missed something?

--
 Laurent


Re: Documentation feedback: surprising behavior of null substitutes

2016-05-20 Thread Laurent Bercot

On 20/05/2016 17:42, Max Ivanov wrote:

Docs on 'importas' specify that missing env var without a default
value would produce a "null arg", however nowhere else term "null arg"
is used or described (including very important "el_substitute"
document), which lead to a surprising result at least for me:

```
emptyenv -p import -u VAR s6-echo ABC:${VAR}:XYZ 123
```

prints just "123", instead of expected "ABC::XYZ 123"


 Documentation for the -D option to importas: "If envvar is undefined,
and this option is not given, substitute zero word for variable instead
of the empty word".

 But you're right, despite it being a natural consequence of the
substitution rules, it's not intuitive that a word that contains ${VAR}
is completely removed when VAR is undefined. I will add a note to the
importas documentation that clarifies this.

--
 Laurent



udevd log

2016-05-20 Thread Eric Vidal
Hello,

I try to have log about udevd. this is the run file for udevd service.

#!/usr/local/bin/execlineb -P
exec -c 
udevd

I have files producer-for and pipeline-name declared.

This is the run file for udevd-log

#!/usr/local/bin/execlineb -P
fdmove -c 2 1
foreground { 
if -n { s6-test -d /var/log/udevd }
if { s6-mkdir -p /var/log/udevd }
chown -R s6log:log /var/log/udevd
}
unexport ?
s6-setuidgid s6log
exec -c 
s6-log t s100 n3 /var/log/udevd

I have a file consumer-for.

So these two service start properly. But when i put an usb stick on a usb port, 
udevd write on the console what it does but i have nothing on the log.
Well, i don't understand correctly what happens here. Someone can explain me my 
mistake, please?

-- 
Eric Vidal