:: Re: [Dng] vdev status update
Página Principal
Delete this message
Reply to this message
Autor: Jude Nelson
Data:  
Para: Jaromil
CC: dng@lists.dyne.org
Assunto: Re: [Dng] vdev status update
Hey Jaromil,

> isn't the script called with execve or similar, so one can just choose

any shell?

Yes. Specifically: "execle( "/bin/sh", "sh", "-c", cmd, (char*)0, env
);", where cmd is the contents of the command= directive, and env is the
list of vdev-exported environment variables (all prefixed with "VDEV_").
NB: Vdev delegates setting up the shell environment beyond this to the
admin to ensure that a well-known PATH gets set, and to ensure that nothing
sensitive leaks over from vdev's environment to the script.

-Jude

On Sun, Feb 22, 2015 at 9:16 PM, Jaromil <jaromil@???> wrote:

>
> hi Jude,
>
> On Sun, 22 Feb 2015, Jude Nelson wrote:
>
> >    Hey everyone,
> >    In keeping with the request to give more frequent status updates on
> >    development, here's where things stand now with vdev.

>
> many thanks!
>
> one quick q (sry if I don't answer it myself looking at the code...)
>
> >    (1) Create a vdev "action" file that tells vdev to run a script
> whenever
> >    it adds or removes a character device:

> >
> >    $ cat example/actions/char.act
> >    [vdev-action]
> >    event=any
> >    type=char
> >    command=exec $VDEV_HELPERS/char.sh
> >    (The line on the "command=" directive gets fed directly into /bin/sh;
> >    $VDEV_HELPERS is the path to the directory holding shell scripts and
> >    programs to set up devices, akin to /lib/udev).

>
> what do you mean by "fed directly into /bin/sh" ?
>
> isn't the script called with execve or similar, so one can just choose
> any shell?
>
> thanks
> ciao
>
>
>