[LFS Trac] #1728: Chapter 6 - Package Management - Explain why 'install' is generally safer than 'cp'

LFS Trac trac at linuxfromscratch.org
Tue May 2 16:53:00 PDT 2006


#1728: Chapter 6 - Package Management - Explain why 'install' is generally safer
than 'cp'
-----------------------------------------+----------------------------------
 Reporter:  gerard at linuxfromscratch.org  |        Owner:  lfs-book at linuxfromscratch.org
     Type:  enhancement                  |       Status:  new                          
 Priority:  normal                       |    Milestone:  Future                       
Component:  Book                         |      Version:  SVN                          
 Severity:  normal                       |   Resolution:                               
 Keywords:                               |  
-----------------------------------------+----------------------------------
Comment (by bdubbs at linuxfromscratch.org):

 I thought I answered this a few days ago, bit I can't find the post.  I
 reviewed the cource code to both install and cp.  Both do extensive error
 checking, but in the end both call a common routine, copy, to actually put
 the destination file in place.  From my review, I am convinced that
 install is not *safer* than cp, but is a convenience for installers in
 that it copies and can set permissions and owner/group with one command.
 Of course there are other switches that are different too, but the safety
 issue is not there.

 One comment is that libraries in use are handled better by install.  Not
 so.  If you copy over a file that is in use, the inode is updated in the
 directory, but the original open file is not deleted until the last
 process that has the file open terminates.  There is nothing in install
 that checks to see if a file is in use.

-- 
Ticket URL: <http://wiki.linuxfromscratch.org/lfs/ticket/1728>
LFS Trac <http://wiki.linuxfromscratch.org/lfs/>
Linux From Scratch: Your Distro, Your Rules.



More information about the lfs-book mailing list