aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2010-04-26 14:54:04 +0100
committerDavid Howells <dhowells@redhat.com>2010-04-26 14:54:04 +0100
commitb1351143e36132b816bcaf4fbda00e01ee025eaf (patch)
tree789605595c2dc7aef824d2ba7a2b5bbea086bc97
parent7202706b3c7d3cb302cdd23c260e74a0ab4a6b46 (diff)
downloadcachefilesd-b1351143e36132b816bcaf4fbda00e01ee025eaf.tar.gz
Move the default cache location to /var/cache/fscache
Move the default cache location to /var/cache/fscache to be consistent with other packages that have caches. Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r--README8
-rw-r--r--cachefilesd.c2
-rw-r--r--cachefilesd.conf2
-rw-r--r--cachefilesd.conf.515
-rw-r--r--howto.txt12
-rw-r--r--redhat/cachefilesd.spec9
-rw-r--r--selinux/cachefilesd.fc1
7 files changed, 26 insertions, 23 deletions
diff --git a/README b/README
index 2c1ac8d..9e55694 100644
--- a/README
+++ b/README
@@ -368,10 +368,10 @@ The policy source files are for reference installed as:
/usr/share/doc/cachefilesd-*/cachefilesd.fc
/usr/share/doc/cachefilesd-*/cachefilesd.if
-By default, the cache is located in /var/fscache, but if it is desirable that
-it should be elsewhere, than either the above policy files must be altered, or
-an auxiliary policy must be installed to label the alternate location of the
-cache.
+By default, the cache is located in /var/cache/fscache, but if it is desirable
+that it should be elsewhere, than either the above policy files must be
+altered, or an auxiliary policy must be installed to label the alternate
+location of the cache.
For instructions on how to add an auxiliary policy to enable the cache to be
located elsewhere when SELinux is in enforcing mode, please see:
diff --git a/cachefilesd.c b/cachefilesd.c
index 4887c42..c89de31 100644
--- a/cachefilesd.c
+++ b/cachefilesd.c
@@ -11,7 +11,7 @@
*
* Configuration file goes in /etc/cachefiles.conf and is of the form:
*
- * dir /var/fscache
+ * dir /var/cache/fscache
* tag mycache
* brun 10%
* bcull 7%
diff --git a/cachefilesd.conf b/cachefilesd.conf
index 793d7e2..6905281 100644
--- a/cachefilesd.conf
+++ b/cachefilesd.conf
@@ -10,7 +10,7 @@
#
###############################################################################
-dir /var/fscache
+dir /var/cache/fscache
tag mycache
brun 10%
bcull 7%
diff --git a/cachefilesd.conf.5 b/cachefilesd.conf.5
index 28d4a30..8cf617b 100644
--- a/cachefilesd.conf.5
+++ b/cachefilesd.conf.5
@@ -98,7 +98,7 @@ This mask can also be set through /sys/module/cachefiles/parameters/debug.
As an example, consider the following:
.P
.RS
-dir /var/fscache
+dir /var/cache/fscache
.br
secctx cachefiles_kernel_t
.br
@@ -113,12 +113,13 @@ bstop 3%
secctx system_u:system_r:cachefiles_kernel_t:s0
.RE
.P
-This places the cache storage objects in a directory called "/var/fscache",
-names the cache "mycache", permits the cache to run freely as long as there's
-at least 10% free space on /var/fscache/, starts culling the cache when the
-free space drops below 7% and stops writing new stuff into the cache if the
-amount of free space drops below 3%. If the cache is suspended, it won't
-reactivate until the amount of free space rises again to 10% or better.
+This places the cache storage objects in a directory called
+"/var/cache/fscache", names the cache "mycache", permits the cache to run
+freely as long as there's at least 10% free space on /var/cache/fscache/,
+starts culling the cache when the free space drops below 7% and stops writing
+new stuff into the cache if the amount of free space drops below 3%. If the
+cache is suspended, it won't reactivate until the amount of free space rises
+again to 10% or better.
.P
Furthermore, this will tell the kernel module the security context it should
use when accessing the cache (SELinux is assumed to be the LSM in this
diff --git a/howto.txt b/howto.txt
index 1114ea2..02f037e 100644
--- a/howto.txt
+++ b/howto.txt
@@ -81,10 +81,10 @@ be overviewed here. The cachefilesd package will need to be installed to use
the cache.
The administrator first needs to decide which directory they want to place the
-cache in (typically /var/fscache) and specify that to the system:
+cache in (typically /var/cache/fscache) and specify that to the system:
[/etc/cachefilesd.conf]
- dir /var/fscache
+ dir /var/cache/fscache
The cache will be stored in the filesystem that hosts that directory. For
something like a laptop, you'll probably want to select the root directory
@@ -100,7 +100,7 @@ following:
or by mounting the filesystem like this:
- mount /dev/hda6 /var/fscache/ -o user_xattr
+ mount /dev/hda6 /var/cache/fscache/ -o user_xattr
All other requirements should be met by using a RHEL5+ or FC6+ kernel and using
Ext3 (ReiserFS and XFS will also meet the requirements). See the "Further
@@ -258,9 +258,9 @@ particular NFS share/volume/export, and "no" when it hasn't.
RELOCATING THE CACHE
====================
-By default, the cache is located in /var/fscache, but this may be undesirable.
-Unless SELinux is being used in enforcing mode, relocating the cache is
-trivially a matter of changing the "dir" line in /etc/cachefilesd.
+By default, the cache is located in /var/cache/fscache, but this may be
+undesirable. Unless SELinux is being used in enforcing mode, relocating the
+cache is trivially a matter of changing the "dir" line in /etc/cachefilesd.
However, if SELinux is being used in enforcing mode, then it's not that
simple. The security policy that governs access to the cache must be changed.
diff --git a/redhat/cachefilesd.spec b/redhat/cachefilesd.spec
index d9b14bd..40a9747 100644
--- a/redhat/cachefilesd.spec
+++ b/redhat/cachefilesd.spec
@@ -11,7 +11,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
BuildRequires: automake, autoconf
Requires(post): /sbin/chkconfig, /sbin/service
Requires(preun): /sbin/chkconfig, /sbin/service
-Requires: selinux-policy-base = 3.7.10-5
+Requires: selinux-policy-base = 3.7.19-5
%description
The cachefilesd daemon manages the caching files and directory that are
@@ -39,7 +39,7 @@ mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d
mkdir -p %{buildroot}%{_mandir}/{man5,man8}
mkdir -p %{buildroot}/usr/share/doc/%{name}-%{version}
mkdir -p %{buildroot}/usr/share/doc/%{name}-selinux-%{version}
-mkdir -p %{buildroot}%{_localstatedir}/fscache
+mkdir -p %{buildroot}%{_localstatedir}/cache/fscache
make DESTDIR=%{buildroot} install
install -m 644 cachefilesd.conf %{buildroot}%{_sysconfdir}
@@ -65,7 +65,7 @@ fi
%postun
if [ $1 -eq 0 ]; then
# Fix up non-standard directory context
- /sbin/restorecon -R %{_localstatedir}/fscache || :
+ /sbin/restorecon -R %{_localstatedir}/cache/fscache || :
fi
%files
@@ -80,12 +80,13 @@ fi
%attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/cachefilesd
/sbin/*
%{_mandir}/*/*
-%{_localstatedir}/fscache
+%{_localstatedir}/cache/fscache
%changelog
* Fri Apr 23 2010 David Howells <dhowells@redhat.com>
- The SELinux policies for cachefilesd now live in the selinux-policy RPM, so
the cachefilesd-selinux RPM is now redundant.
+- Move the default cache dir to /var/cache/fscache.
* Thu Feb 25 2010 David Howells <dhowells@redhat.com>
- Fix the SELinux policies for cachefilesd.
diff --git a/selinux/cachefilesd.fc b/selinux/cachefilesd.fc
index b2db20b..08caa54 100644
--- a/selinux/cachefilesd.fc
+++ b/selinux/cachefilesd.fc
@@ -24,5 +24,6 @@
/sbin/cachefilesd -- gen_context(system_u:object_r:cachefilesd_exec_t,s0)
/dev/cachefiles -c gen_context(system_u:object_r:cachefiles_dev_t,s0)
/var/fscache(/.*)? gen_context(system_u:object_r:cachefiles_var_t,s0)
+/var/cache/fscache(/.*)? gen_context(system_u:object_r:cachefiles_var_t,s0)
/var/run/cachefilesd.pid -- gen_context(system_u:object_r:cachefiles_var_t,s0)