1#!/bin/sh
2#
3# $FreeBSD: head/etc/rc.d/apmd 230099 2012-01-14 02:18:41Z dougb $
4#
5
6# PROVIDE: apmd
7# REQUIRE: DAEMON apm
8# BEFORE: LOGIN
9# KEYWORD: nojail shutdown
10
11. /etc/rc.subr
12
13name="apmd"
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 # Enable apm if it is not already enabled
23 if ! checkyesno apm_enable && \
24 ! /etc/rc.d/apm forcestatus 1>/dev/null 2>&1
25 then
26 force_depend apm || return 1
27 fi
28
29 # Warn user about acpi apm compatibility support which
30 # does not work with apmd.
31 if [ ! -e /dev/apmctl ]; then
32 warn "/dev/apmctl not found; kernel is missing apm(4)"
33 fi
34 ;;
35 *)
36 return 1
37 ;;
38 esac
39 return 0
40}
41
42load_rc_config $name
43run_rc_command "$1"
2#
3# $FreeBSD: head/etc/rc.d/apmd 230099 2012-01-14 02:18:41Z dougb $
4#
5
6# PROVIDE: apmd
7# REQUIRE: DAEMON apm
8# BEFORE: LOGIN
9# KEYWORD: nojail shutdown
10
11. /etc/rc.subr
12
13name="apmd"
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 # Enable apm if it is not already enabled
23 if ! checkyesno apm_enable && \
24 ! /etc/rc.d/apm forcestatus 1>/dev/null 2>&1
25 then
26 force_depend apm || return 1
27 fi
28
29 # Warn user about acpi apm compatibility support which
30 # does not work with apmd.
31 if [ ! -e /dev/apmctl ]; then
32 warn "/dev/apmctl not found; kernel is missing apm(4)"
33 fi
34 ;;
35 *)
36 return 1
37 ;;
38 esac
39 return 0
40}
41
42load_rc_config $name
43run_rc_command "$1"