]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/rc.d/apmd
Merge branch 'releng/11.3' into releng-CDN/11.3
[FreeBSD/FreeBSD.git] / etc / rc.d / apmd
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: apmd
7 # REQUIRE: DAEMON apm
8 # BEFORE:  LOGIN
9 # KEYWORD: nojail shutdown
10
11 . /etc/rc.subr
12
13 name="apmd"
14 desc="Advanced power management daemon"
15 rcvar="apmd_enable"
16 command="/usr/sbin/${name}"
17 start_precmd="apmd_prestart"
18
19 apmd_prestart()
20 {
21         case `${SYSCTL_N} hw.machine_arch` in
22         i386)
23                 force_depend apm || return 1
24
25                 # Warn user about acpi apm compatibility support which
26                 # does not work with apmd.
27                 if [ ! -e /dev/apmctl ]; then
28                         warn "/dev/apmctl not found; kernel is missing apm(4)"
29                 fi
30                 ;;
31         *)
32                 return 1
33                 ;;
34         esac
35 }
36
37 load_rc_config $name
38 run_rc_command "$1"