[lug] q:#!/usr/bin/env python

Chan Kar Heng chankarheng at gmail.com
Sun Dec 11 13:04:34 MST 2011


Hi, seem to have found a bit more info on my previous post.
Most of the environment runs on busybox (has a /bin/busybox & most 
things are symlinks to it; ie: /bin/su <- /bin/busybox, /usr/bin/env <- 
/bin/busybox).

That seems to be part of the problem.
For su to work, it has to has u+s.
Setting that causes busybox to have u+s.
Seems to mess things up a bit for unknown reasons to me.

Once I do chmod 755 to /bin/busybox, things are back to normal for me.

Hope to hear from anyone if there're clues.

Thanks in advance & best regards,

KarHeng

On 2011-12-12 03:44, Chan Kar Heng wrote:
> Hi,
>
> Would like to seek some opinion & advise on how #!/usr/bin/env python is
> different from #!/usr/bin/python.
> I do know that env python would make env search for python in PATH & run
> that instance, but am looking for a difference beyond that due to a
> problem I'm having. Would like to understand so that I can debug more on
> my own.
>
> Say I have "#!/usr/bin/env python" at the start of a script called
> /opt/alarmed/alarmed.py.
>
> Running command below successfully executes the script & brings up the
> GUI perfectly well:
>
> python /opt/alarmed/alarmed.py
>
> However, running command below, successfully executes the script too,
> but the GUI becomes broken.
>
> env python /opt/alarmed/alarmed.py
>
> So, I'd like to understand what's different between the 2 (using
> /usr/bin/env & not using it)...
>
> There're even posts on this:
>
> http://talk.maemo.org/archive/index.php/t-42159.html
>
> It's not conclusive yet however..
>
> Thanks in advance & best regards,
>
> KarHeng



More information about the LUG mailing list