[lsb-discuss] Re: Updating the PATH for /opt/<package>/bin

Thomas Sippel - Dau t.sippel-dau at imperial.ac.uk
Thu Jun 26 05:22:56 PDT 2003

Bart Whiteley wrote:
> Is it appropriate for an "add-on" application to update the
> system PATH to include /opt/<package>/bin?
> If so, what is the recommended way to accomplish this?

Well, if you can get it right ... You should:

  o  analyse the system how it does the user validation
     files, NIS, Distributed Services, Active Directory, LDAP, ...

  o  using this method get a list of users allowed to run on the system.
     Note that, according to orange book, a user on a system
     should not be able to browse the user data base this way,
     that is why the getpwent()(sp?) and similar functions have been
     marked obsolete and withdrawn in the XPG3 and POSIX interfaces,
     so to be portable, you better use a different method

  o  analyse the password record entries for the users to extract
     home directory and startup shell

  o  analyse the startup shell documentation how they initialise
     the user environment, since the shells must be installed in
     order to allow the user logging on, you could start at the
     man pages.

  o  read the shell startup files in the user's home directory
     and patch the PATH setup. Note that NFS servers will not
     normally allow root on a random client to read (non-public)
     user files.

  o  Now the difficult bit, decide whether the user wants the new
     directory to be at the top or bottom of the PATH. Can't
     give you any hints there, I am afraid, but you better make
     sure you do not break anything the user does not want broken.

  o  Wrap it all up into a postinstall script, and publish.
     If it works well, people will be very grateful.

So the real morale is, if you do something for sombody, be sure
who they are and what they want. Otherwise you will look as 
battered and scratched as the proverbial boy scout who came
all scratched and bruised to a cub meeting. On being asked 
what happened to him, he said that on the way to the meeting
he did his daily good deed and helped an elderly woman across
the road, but the old bitch did just not want to go.


*   Why not use metric units and get it right first time, every time ?
*   email: cmaae47 @ imperial.ac.uk
*   voice: +4420-7594-6912 (day)
*   fax:   +4420-7594-6958
*   snail: Thomas Sippel - Dau
*          Linux Services Manager
*          Unix Support Group
*          Information and Communication Technologies
*          Imperial College of Science, Technology and Medicine
*          Exhibition Road
*          London SW7 2BX
*          Great Britain

More information about the lsb-discuss mailing list