diff options
author | brooks <brooks@FreeBSD.org> | 2006-01-11 21:30:41 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2006-01-11 21:30:41 +0000 |
commit | b818dbf01059c4e2853d83287cf6991cd54cc012 (patch) | |
tree | 18622e2772225f1344c04b82de86de63c2f463e1 /etc/rc.d/abi | |
parent | 92d869103ca47efc2e62545180a4ffbbec6ca23c (diff) | |
download | FreeBSD-src-b818dbf01059c4e2853d83287cf6991cd54cc012.zip FreeBSD-src-b818dbf01059c4e2853d83287cf6991cd54cc012.tar.gz |
Be a little more read-only file system friendly when running the Linux
ldconfig. Build the cache in a temporary directory and only install it
if it's actually different that the installed one.
Also, use "cat tmp > real" to install the temporary file in the real
location to allow the real location to be a symlink to a writable
directory such as /var/run (where the file actually belongs).
MFC After: 5 days
Diffstat (limited to 'etc/rc.d/abi')
-rw-r--r-- | etc/rc.d/abi | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/etc/rc.d/abi b/etc/rc.d/abi index a60fd68..567e726 100644 --- a/etc/rc.d/abi +++ b/etc/rc.d/abi @@ -29,7 +29,12 @@ linux_start() kldload linux > /dev/null 2>&1 fi if [ -x /compat/linux/sbin/ldconfig ]; then - /compat/linux/sbin/ldconfig + _tmpdir=`mktemp -d -t linux-ldconfig` + /compat/linux/sbin/ldconfig -C ${_tmpdir}/ld.so.cache + if ! cmp -s ${_tmpdir}/ld.so.cache /compat/linux/etc/ld.so.cache; then + cat ${_tmpdir}/ld.so.cache > /compat/linux/etc/ld.so.cache + fi + rm -rf ${_tmpdir} fi } |