bin/100287: /etc/rc.subr cannot deal properly with interpreted
daemons whos shebang uses /usr/bin/env
rob at oxdi.co.uk
Fri Jul 14 10:40:18 UTC 2006
>Synopsis: /etc/rc.subr cannot deal properly with interpreted daemons whos shebang uses /usr/bin/env
>Arrival-Date: Fri Jul 14 10:40:16 GMT 2006
>Originator: Rob Pitt
Oxygen Digital Industries Ltd
When you create a script to manage starting and stopping a daemon written in an interpreted language then you supply command_interpreter to set the interpreter being used to execute the daemon (i.e. /usr/local/bin/python). If the interpreted daemon uses a shebang referencing /usr/bin/env to locate it's interpreter (a good practice for a multi-platform daemon), i.e.:
Then the rc.subr script gets confused because it thinks the interpreter is "/usr/bin/env " (including that last space).
You can work around this by changing the daemons shebang to point at the actual location of the interpreter, i.e.:
However, while trivial this is far from ideal because it means additional, unnecessary patching and the rc.subr script could be made to handle this gracefully.
1. See description
The rc.subr script could assume that "foobar" is the correct interpreter value when it sees "#!/usr/bin/env foobar"
More information about the freebsd-bugs