<sys/mount.h>: Include <sys/mplock2.h> for self sufficiency.
[dragonfly.git] / etc / rc.d / fsck
blob0be91c36862d9d56c76d5f2490d3d06e3909f9b5
1 #!/bin/sh
3 # $NetBSD: fsck,v 1.2 2001/06/18 06:42:35 lukem Exp $
4 # $FreeBSD: src/etc/rc.d/fsck,v 1.4 2002/10/12 10:31:31 schweikh Exp $
7 # PROVIDE: fsck
8 # REQUIRE: disks
10 . /etc/rc.subr
12 name="fsck"
13 start_cmd="fsck_start"
14 stop_cmd=":"
16 fsck_start()
18 if [ "$autoboot" = no ]; then
19 echo "Fast boot: skipping disk checks."
20 elif [ "$autoboot" = yes ]; then
21 # During fsck ignore SIGQUIT
22 trap : 3
24 echo "Starting file system checks:"
25 fsck -p
27 case $? in
31 stop_boot
34 echo "Rebooting..."
35 reboot
36 echo "Reboot failed; help!"
37 stop_boot
40 if checkyesno fsck_y_enable; then
41 echo "File system preen failed, trying fsck -y."
42 fsck -y
43 case $? in
47 echo "Automatic file system check failed; help!"
48 stop_boot
50 esac
51 else
52 echo "Automatic file system check failed; help!"
53 stop_boot
56 12)
57 echo "Boot interrupted."
58 stop_boot
60 130)
61 stop_boot
64 echo "Unknown error; help!"
65 stop_boot
67 esac
71 load_rc_config $name
72 run_rc_command "$1"