Bug 123995

Summary: change fixfiles to not delete fixfiles logfiles and to log changes
Product: [Fedora] Fedora Reporter: Tom London <selinux>
Component: policycoreutilsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED CURRENTRELEASE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 2CC: dwalsh, pgraner
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-06-03 17:40:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tom London 2004-05-22 16:54:23 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510

Description of problem:
Would be nice if 'fixfiles relabel' did not delete logfiles from
previous runs of fixfiles.

Also, would be nice if 'fixfiles relabel' recorded labeling changes to
logfile (OK if not sent to console).

Does it make sense to change the 'relabel()' fn in fixfiles from:
     relabel() {
     echo "Cleaning out /tmp"
     rm -rf /tmp/.??* /tmp/*
     ${SETFILES} ${FC} ${FILESYSTEMS} 2>&1 | tee $LOGFILE
     }
 to something like:
     relabel() {
     echo "Cleaning out /tmp (saving previous fixfiles logs)"
     find /tmp -maxdepth 1 -mindepth 1 | grep -v /tmp/fixfiles | xargs
rm -rf 
     ${SETFILES} -v ${FC} ${FILESYSTEMS} 2>&1 | tee $LOGFILE | grep -v
 "/usr/sbin/setfiles: relabeling" }

(Notice the addition of the '-v' argument to ${SETFILES}).

This way the changes are logged (but not displayed on the console),
and previous log files are retained.


Version-Release number of selected component (if applicable):
policycoreutils-1.11-2

How reproducible:
Always

Steps to Reproduce:
1. uhhh
2.
3.
    

Additional info: