[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1895: run-parts does not run scripts without #!/...



Harald Schueler writes ("Re: Bug#1895: run-parts does not run scripts without #!/..."):
> What it does is documented: It calls execvp, which in turn executes only
> script _with_ #!/interpreter (or binaries of course).

Yes, I'm aware that execvp only runs scripts that are in the proper
executable format.

> If we want run-parts to execute scripts without #!/interpreter, then the
> following should work:

That's not what I want.  Something without a #! line isn't a proper
script.

What I want is to be able to write code using system() in Perl that
reliably produces exactly one error message if something goes wrong.

The usual convention is that - because there is hardly any channel
from the forked process to the parent - the child after the fork
prints any error messages.

What I'm complaining about is that Perl doesn't seem to give any way
to distinguish the case where the child's exec failed and the child
exited with a bad status and the case where the exec succeeded, the
process that was run failed, produced an error message, and then
exited with a bad status.

The whole design of system() in Perl isn't conducive to good
error-trapping.  I suppose it might be better to use fork oneself.

Jeff (you're the maintainer of this package, aren't you?) - would you
like me to send you an update that uses fork directly and produces an
error message in this case ?

Ian.


Reply to: