[Gllug] /usr/bin/env and the web server user account

gvim gvimrc at gmail.com
Fri May 20 12:35:01 UTC 2011


On 20/05/2011 00:23, Steve Parker wrote:
> On 19/05/11 22:21, gvim wrote:
>> I've read that:
>>
>> /usr/bin/env perl
>>
>> .... rather than:
>>
>> /usr/bin/perl
>>
>> .... is the way to go as it solves portability problems but it
>> seems to introduce new problems. If my perl script is running as a
>> CGI the owner of that process will be the owner of the web server
>> process, typically 'www' or 'apache'. Since these system user
>> accounts are non-login $PATH is non-configurable, defeating the
>> purpose of /usr/bin/env, surely?
> I would say so, yes. If there is no environment, why bother changing
> (or unsetting) it with env? I've never used this syntax, but have
> seen it used enough times, and my understanding is (as you say) that
> it is to provide a clean environment: /usr/bin/env FOO=bar myapp.
> From info: 23.2 `env': Run a command in a modified environment

The thing is a number of Perl and Python frameworks use:

/usr/bin/env perl
/usr/bin/env python

... so all the bazillion files you download, and those which are generated by startup scripts, use these shebang lines. I thought of modifying the $PATH at system level so that system accounts inherit but on CentOS it's not as simple as edit /etc/profile and /etc/bashrc. Still a bit of a mystery which scripts contribute to the default $PATH.

gvim
--
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list