=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/etc/rc,v retrieving revision 1.461 retrieving revision 1.462 diff -c -r1.461 -r1.462 *** src/etc/rc 2015/09/12 14:48:06 1.461 --- src/etc/rc 2015/09/13 09:22:05 1.462 *************** *** 1,4 **** ! # $OpenBSD: rc,v 1.461 2015/09/12 14:48:06 sthen Exp $ # System startup script run by init on autoboot or after single-user. # Output and error are redirected to console by init, and the console is the --- 1,4 ---- ! # $OpenBSD: rc,v 1.462 2015/09/13 09:22:05 rpe Exp $ # System startup script run by init on autoboot or after single-user. # Output and error are redirected to console by init, and the console is the *************** *** 158,217 **** ssh-keygen -A } ! # Create Unix sockets directories for X if needed and make sure they have ! # correct permissions. ! setup_X_sockets() { ! if [ -d /usr/X11R6/lib ]; then ! for d in /tmp/.X11-unix /tmp/.ICE-unix ; do ! if [ -d $d ]; then ! if [ `ls -ld $d | cut -d' ' -f4` \ ! != root ]; then ! chown root $d ! fi ! if [ `ls -ld $d | cut -d' ' -f1` \ ! != drwxrwxrwt ]; then ! chmod 1777 $d ! fi ! elif [ -e $d ]; then ! echo "Error: $d exists and isn't a directory." ! else ! mkdir -m 1777 $d ! fi ! done ! fi ! } ! ! # Check filesystems, optionally by using a flag for fsck(8) passed as $1. do_fsck() { ! local _flags=$1 ! ! fsck -p $_flags case $? in ! 0) ;; ! 2) ! exit 1 ! ;; ! 4) ! echo "Rebooting..." reboot echo "Reboot failed; help!" exit 1 ;; ! 8) ! echo "Automatic file system check failed; help!" exit 1 ;; ! 12) ! echo "Boot interrupted." exit 1 ;; ! 130) ! # Interrupt before catcher installed. exit 1 ;; ! *) ! echo "Unknown error; help!" exit 1 ;; esac --- 158,186 ---- ssh-keygen -A } ! # Check filesystems, optionally by using a fsck(8) flag. ! # Usage: do_fsck [-flag] do_fsck() { ! fsck -p "$@" case $? in ! 0) ;; ! 2) exit 1 ;; ! 4) echo "Rebooting..." reboot echo "Reboot failed; help!" exit 1 ;; ! 8) echo "Automatic file system check failed; help!" exit 1 ;; ! 12) echo "Boot interrupted." exit 1 ;; ! 130) # Interrupt before catcher installed. exit 1 ;; ! *) echo "Unknown error; help!" exit 1 ;; esac *************** *** 436,442 **** find . -maxdepth 1 ! -name . ! -name lost+found ! -name quota.user \ ! -name quota.group ! -name vi.recover -execdir rm -rf -- {} \;) ! setup_X_sockets [ -f /etc/rc.securelevel ] && sh /etc/rc.securelevel # rc.securelevel did not specifically set -1 or 2, so select the default: 1. --- 405,413 ---- find . -maxdepth 1 ! -name . ! -name lost+found ! -name quota.user \ ! -name quota.group ! -name vi.recover -execdir rm -rf -- {} \;) ! # Create Unix sockets directories for X if needed and make sure they have ! # correct permissions. ! [[ -d /usr/X11R6/lib ]] && mkdir -m 1777 /tmp/.{X11,ICE}-unix [ -f /etc/rc.securelevel ] && sh /etc/rc.securelevel # rc.securelevel did not specifically set -1 or 2, so select the default: 1.