xref: /freebsd/libexec/rc/rc.d/dmesg (revision cfd6422a5217410fbd66f7a7a8a64d9d85e61229)
1#!/bin/sh
2#
3# $FreeBSD$
4#
5
6# PROVIDE: dmesg
7# REQUIRE: mountcritremote FILESYSTEMS
8# BEFORE:  DAEMON
9# KEYWORD: nojail
10
11. /etc/rc.subr
12
13name="dmesg"
14desc="Save kernel boot messages to disk"
15rcvar="dmesg_enable"
16dmesg_file="/var/run/dmesg.boot"
17start_cmd="do_dmesg"
18stop_cmd=":"
19
20do_dmesg()
21{
22	rm -f ${dmesg_file}
23	( umask 022 ; /sbin/dmesg $rc_flags > ${dmesg_file} )
24}
25
26load_rc_config $name
27run_rc_command "$1"
28