print a warning if no swap devices are configured and "no_swap" is not YES.

This commit is contained in:
mrg 1997-11-23 04:17:57 +00:00
parent 191d34513d
commit d2cfb19c3d
2 changed files with 12 additions and 2 deletions

8
etc/rc
View File

@ -1,4 +1,4 @@
# $NetBSD: rc,v 1.96 1997/11/11 02:28:58 jonathan Exp $
# $NetBSD: rc,v 1.97 1997/11/23 04:17:57 mrg Exp $
# originally from: @(#)rc 8.2 (Berkeley) 3/17/94
# System startup script run by init on autoboot
@ -123,6 +123,12 @@ done
# systems (or, at least, better).
swapctl -A -t noblk
# Check for no swap, and warn about it unless that is desired.
if [ "$no_swap" != YES ]; then
swapctl -s | grep 'no swap devices configured' > /dev/null && \
echo "WARNING: no swap space configured!"
fi
# clean up left-over files
rm -f /etc/nologin
rm -f /var/spool/lock/LCK.*

View File

@ -1,4 +1,4 @@
# $NetBSD: rc.conf,v 1.24 1997/11/17 17:45:31 mrg Exp $
# $NetBSD: rc.conf,v 1.25 1997/11/23 04:17:58 mrg Exp $
#
# see rc.conf(5) for more information.
@ -19,6 +19,10 @@ defaultroute="" # if blank, use /etc/mygate
# Filesystems (besides /usr and /var) to mount early in boot-up
critical_filesystems=""
# Set this to YES if you have purposefully setup no swap partitions and
# don't want to be warned about it
no_swap=""
# One-time actions and programs on boot-up.
lkm=YES # run /etc/rc.lkm
savecore=YES savecore_flags=""