Browse Source

Make /var/tmp a symbolic link to /tmp. The creation of /var/tmp in the

often space-constrained /var filesystem was a historical mistake.  There
are big implications for the daemons which assume they won't run out of
space, and this is a first step towards trying to improve the situation.
Move /tmp to the same 7-day expiration rules that /var/tmp had.
vi.recover works just as well as before, except on memory filesystems;
indicating that vi should be repaired to write files into homedirs or
something.
done with rpe
ok many
OPENBSD_5_7
deraadt 10 years ago
parent
commit
854a626186
4 changed files with 9 additions and 25 deletions
  1. +2
    -1
      src/etc/Makefile
  2. +2
    -13
      src/etc/daily
  3. +1
    -7
      src/etc/mtree/4.4BSD.dist
  4. +4
    -4
      src/etc/rc

+ 2
- 1
src/etc/Makefile View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.398 2014/10/03 19:22:38 deraadt Exp $
# $OpenBSD: Makefile,v 1.399 2014/11/17 18:19:08 deraadt Exp $
TZDIR= /usr/share/zoneinfo TZDIR= /usr/share/zoneinfo
LOCALTIME= Canada/Mountain LOCALTIME= Canada/Mountain
@ -210,6 +210,7 @@ distribution-etc-root-var: distrib-dirs
${DESTDIR}/etc/rc.d && \ ${DESTDIR}/etc/rc.d && \
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 ${RCDAEMONS} \ ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 ${RCDAEMONS} \
${DESTDIR}/etc/rc.d ${DESTDIR}/etc/rc.d
cd ${DESTDIR}/var; ln -fs ../tmp
touch ${DESTDIR}/usr/share/sysmerge/etcsum touch ${DESTDIR}/usr/share/sysmerge/etcsum
touch ${DESTDIR}/usr/share/sysmerge/examplessum touch ${DESTDIR}/usr/share/sysmerge/examplessum
cd ${DESTDIR}/ && \ cd ${DESTDIR}/ && \


+ 2
- 13
src/etc/daily View File

@ -1,5 +1,5 @@
# #
# $OpenBSD: daily,v 1.81 2014/07/02 13:39:41 sthen Exp $
# $OpenBSD: daily,v 1.82 2014/11/17 18:19:08 deraadt Exp $
# From: @(#)daily 8.2 (Berkeley) 1/25/94 # From: @(#)daily 8.2 (Berkeley) 1/25/94
# #
# For local additions, create the file /etc/daily.local. # For local additions, create the file /etc/daily.local.
@ -50,18 +50,7 @@ if [ -d /tmp -a ! -L /tmp ]; then
find -x . \ find -x . \
\( -path './ssh-*' -o -path ./.X11-unix -o -path ./.ICE-unix \ \( -path './ssh-*' -o -path ./.X11-unix -o -path ./.ICE-unix \
-o -path ./portslocks -o -path './tmux-*' \) \ -o -path ./portslocks -o -path './tmux-*' \) \
-prune -o -type f -atime +3 -execdir rm -f -- {} \; 2>/dev/null
find -x . -type d -mtime +1 ! -path ./vi.recover ! -path ./.X11-unix \
! -path ./.ICE-unix ! -path ./portslocks ! -name . \
-execdir rmdir -- {} \; >/dev/null 2>&1; }
fi
if [ -d /var/tmp -a ! -L /var/tmp ]; then
cd /var/tmp && {
find -x . \
\( -path './ssh-*' -o -path ./.X11-unix -o -path ./.ICE-unix \
-o -path ./portslocks -o -path './tmux-*' \) \
-prune -o ! -type d -atime +7 -execdir rm -f -- {} \; 2>/dev/null
-prune -o -type f -atime +7 -execdir rm -f -- {} \; 2>/dev/null
find -x . -type d -mtime +1 ! -path ./vi.recover ! -path ./.X11-unix \ find -x . -type d -mtime +1 ! -path ./vi.recover ! -path ./.X11-unix \
! -path ./.ICE-unix ! -path ./portslocks ! -name . \ ! -path ./.ICE-unix ! -path ./portslocks ! -name . \
-execdir rmdir -- {} \; >/dev/null 2>&1; } -execdir rmdir -- {} \; >/dev/null 2>&1; }


+ 1
- 7
src/etc/mtree/4.4BSD.dist View File

@ -1,4 +1,4 @@
# $OpenBSD: 4.4BSD.dist,v 1.267 2014/10/09 04:24:30 tedu Exp $
# $OpenBSD: 4.4BSD.dist,v 1.268 2014/11/17 18:19:08 deraadt Exp $
/set type=dir uname=root gname=wheel mode=0755 /set type=dir uname=root gname=wheel mode=0755
@ -779,12 +779,6 @@ var
.. ..
.. ..
# ./var/tmp
tmp mode=01777
vi.recover mode=01777
..
..
# ./var/unbound # ./var/unbound
unbound unbound
etc uname=root gname=wheel mode=0755 etc uname=root gname=wheel mode=0755


+ 4
- 4
src/etc/rc View File

@ -1,4 +1,4 @@
# $OpenBSD: rc,v 1.443 2014/11/05 17:07:59 millert Exp $
# $OpenBSD: rc,v 1.444 2014/11/17 18:19:08 deraadt Exp $
# System startup script run by init on autoboot # System startup script run by init on autoboot
# or after single-user. # or after single-user.
@ -438,12 +438,12 @@ fi
echo clearing /tmp echo clearing /tmp
# prune quickly with one rm, then use find to clean up /tmp/[lq]*
# prune quickly with one rm, then use find to clean up /tmp/[lqv]*
# (not needed with mfs /tmp, but doesn't hurt there...) # (not needed with mfs /tmp, but doesn't hurt there...)
(cd /tmp && rm -rf [a-km-pr-zA-Z]*)
(cd /tmp && rm -rf [a-km-pr-uw-zA-Z]*)
(cd /tmp && (cd /tmp &&
find . -maxdepth 1 ! -name . ! -name lost+found ! -name quota.user \ find . -maxdepth 1 ! -name . ! -name lost+found ! -name quota.user \
! -name quota.group -execdir rm -rf -- {} \;)
! -name quota.group ! -name vi.recover -execdir rm -rf -- {} \;)
setup_X_sockets setup_X_sockets


Loading…
Cancel
Save