Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jul 2006 10:34:26 GMT
From:      Rob Pitt <rob@oxdi.co.uk>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/100287: /etc/rc.subr cannot deal properly with interpreted daemons whos shebang uses /usr/bin/env
Message-ID:  <200607141034.k6EAYQE4054819@www.freebsd.org>
Resent-Message-ID: <200607141040.k6EAeGCr078154@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         100287
>Category:       bin
>Synopsis:       /etc/rc.subr cannot deal properly with interpreted daemons whos shebang uses /usr/bin/env
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 14 10:40:16 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Rob Pitt
>Release:        6.0
>Organization:
Oxygen Digital Industries Ltd
>Environment:
6.0 RELEASE
>Description:
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.:

#!/usr/bin/env python

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.:

#!/usr/local/bin/python

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.
>How-To-Repeat:
1. See description
>Fix:
The rc.subr script could assume that "foobar" is the correct interpreter value when it sees "#!/usr/bin/env foobar"
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607141034.k6EAYQE4054819>