xref: /freebsd/libexec/rc/rc.d/apmd (revision 56b17de1e8360fe131d425de20b5e75ff3ea897c)
1#!/bin/sh
2#
3#
4
5# PROVIDE: apmd
6# REQUIRE: DAEMON apm
7# BEFORE:  LOGIN
8# KEYWORD: nojail shutdown
9
10. /etc/rc.subr
11
12name="apmd"
13desc="Advanced power management daemon"
14rcvar="apmd_enable"
15command="/usr/sbin/${name}"
16start_precmd="apmd_prestart"
17
18apmd_prestart()
19{
20	case `${SYSCTL_N} hw.machine_arch` in
21	i386)
22		force_depend apm || return 1
23
24		# Warn user about acpi apm compatibility support which
25		# does not work with apmd.
26		if [ ! -e /dev/apmctl ]; then
27			warn "/dev/apmctl not found; kernel is missing apm(4)"
28		fi
29		;;
30	*)
31		return 1
32		;;
33	esac
34}
35
36load_rc_config $name
37
38# doesn't make sense to run in a svcj: nojail keyword
39apmd_svcj="NO"
40
41run_rc_command "$1"
42