On 2013/09/21 13:12, Craig R. Skinner wrote:
> As the others here with brains have had a chance to sleep on this,
> what's the current thinking?
> 
> As I understand it, there are 2 decisions to make:
> 
> 1) How to decide if a $daemon is a script as opposed to a binary
>       (*) file(1)

too big, too complex. file(1) has to parse a 500K /etc/magic each
time it runs, which would be 15+ times for this, and uses about 8MB
ram. definitely overkill for identifying the contents of the first
two characters of a file. remember this has to run on a wide range of
platforms.

>       (*) dd(d)
>       (*) sed(1)
>   Could stat(1) be tasked to switch case on file attributes (e.g: size)?

how would size help?

> 
> 2) Whether to check if a script's interpreter is valid
> 
> http://openbsd.7691.n7.nabble.com/etc-rc-d-rc-subr-prefix-pexp-with-script-interpretor-path-td234439.html
> 
> Yes/No/Other?
> -- 
> Craig Skinner | http://twitter.com/Craig_Skinner | http://linkd.in/yGqkv7
> 

How much does this really help anyway? Porters still need to check
the actual string used (for example, it's quite common for perl things
to use "perl: <programnanme>"), and it doesn't take much extra typing
to add a pexp line to the script in cases where it's needed.

I am rather wary of adding complication to rc.subr, iirc one of the
conditions when the subsystem was first added was that it remained
simple..

Reply via email to