[exim] Re: Pipe transport and script (shebang)

Página Inicial
Delete this message
Reply to this message
Autor: Andrew C Aitchison
Data:  
Para: Slavko
CC: exim ML
Assunto: [exim] Re: Pipe transport and script (shebang)
On Mon, 28 Aug 2023, Andrew C Aitchison wrote:

> On Mon, 28 Aug 2023, Slavko via Exim-users wrote:
>
>> Hi all,
>>
>> recently i decide to improve my pipe transport for reports processing
>> to allow relative commands and i go into problems. It was worked
>> without problems with absolute script path for long time. I solved it,
>> but i want to know why that happens...
>>
>> The only changes which i did, are -- i add path option to transport:
>>
>>    path = /my/scripts/path

>>
>> I changed command name to relative (without path) in redirect router:
>>
>>    data = |script_name.py one_arg

>>
>> After message arrived, it fail to run that script, with output:
>>
>>    reports_pipe transport output: /usr/bin/env: 'python3': No such
>>    file or directory

>>
>> I had that in shebang, after i changed shebang to point directly to
>> /usr/bin/python3, it starts to work again.
>>
>> I tried to emulate that from shell by setting PATH variable to the same
>> value as in transport, then i tried to clear it at all, but scripts runs
>> without problem, i tried to find something in env's man page, but i
>> fail...
>>
>> Thus i am curios why that was not problem with full script path but it
>> is problem with relative script path. Can please someone explain me
>> that?
>
> I guess that and your first change meant that /usr/bin/env could no longer
> find pthyon3.


Sorry,  I meant to add
         because env uses path.


> Some say that using /usr/bin/env in shebang helps, but others say it makes
> things worse. With distributions changing from the default python from
> python2 to python3 the mess got more tangled. Find something that works on
> your systems and stick with it.
>
>
> -- 
> Andrew C. Aitchison                      Kendal, UK
>                   andrew@???

>


-- 
Andrew C. Aitchison                      Kendal, UK
                    andrew@???


--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/