From: Kevin G. <ke...@go...> - 2004-08-27 15:52:14
|
Mike Schilli wrote: > Jason Thurston wrote on 8/27/2004, 4:11 AM: > > > Is there a way to specify that permissions to the log files be wide > > open ( -rw-rw-rw- ) ? > > "perldoc -f umask" shows how to accomplish that. Rather than making the log files world-writeable, you might be better off making them group writeable, giving the world read-only access, and if you set the SGID bit on the directory then they are to be sure to be owned by the same group (see http://www.library.yale.edu/~lso/workstation/docs/permissions/sgid.htm). For instance, if your forking process runs as p1user and p2user and p3user and they are all a member of a group called "loguser", then you can do #set the umask either in the perl script or in something like the #.bashrc script for each user via umask 664 #create the directory mkdir logdir/ #make sure the directory is group writeable chmod g+w logdir #make the directory SGID chmod g+s logdir #make it owned by the loguser group chown loguser logdir #the directory will now look like this, #note the 's' in the permissions drwxrwsr-x 2 kgoess loguser 4096 Aug 27 08:47 logdir/ #create a test file touch logdir/foo #the new file is now group writeable by the loguser group -rw-rw-r-- 1 kgoess loguser 0 Aug 27 08:50 foo -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |