2001-06-16 07:16:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-06-13 22:14:37 +00:00
|
|
|
# $FreeBSD$
|
2001-06-16 07:16:14 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: apmd
|
2002-07-07 04:16:53 +00:00
|
|
|
# REQUIRE: DAEMON apm
|
2002-06-13 22:14:37 +00:00
|
|
|
# BEFORE: LOGIN
|
2008-07-16 19:50:29 +00:00
|
|
|
# KEYWORD: nojail shutdown
|
2001-06-16 07:16:14 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="apmd"
|
2016-04-23 16:10:54 +00:00
|
|
|
desc="Advanced power management daemon"
|
2012-01-14 02:18:41 +00:00
|
|
|
rcvar="apmd_enable"
|
2001-06-16 07:16:14 +00:00
|
|
|
command="/usr/sbin/${name}"
|
2004-01-17 11:25:16 +00:00
|
|
|
start_precmd="apmd_prestart"
|
2002-07-07 04:16:53 +00:00
|
|
|
|
|
|
|
apmd_prestart()
|
|
|
|
{
|
2002-10-12 10:31:31 +00:00
|
|
|
case `${SYSCTL_N} hw.machine_arch` in
|
2003-05-06 00:09:51 +00:00
|
|
|
i386)
|
2012-02-14 10:51:24 +00:00
|
|
|
force_depend apm || return 1
|
2003-06-09 17:44:30 +00:00
|
|
|
|
|
|
|
# Warn user about acpi apm compatibility support which
|
|
|
|
# does not work with apmd.
|
|
|
|
if [ ! -e /dev/apmctl ]; then
|
2012-02-14 10:51:24 +00:00
|
|
|
warn "/dev/apmctl not found; kernel is missing apm(4)"
|
2003-06-09 17:44:30 +00:00
|
|
|
fi
|
2002-10-12 10:31:31 +00:00
|
|
|
;;
|
2002-07-07 04:16:53 +00:00
|
|
|
*)
|
|
|
|
return 1
|
|
|
|
;;
|
2002-10-12 10:31:31 +00:00
|
|
|
esac
|
2002-07-07 04:16:53 +00:00
|
|
|
}
|
|
|
|
|
2001-06-16 07:16:14 +00:00
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|