diff options
| author | Brad Davis <brd@FreeBSD.org> | 2018-07-28 20:36:23 +0000 |
|---|---|---|
| committer | Brad Davis <brd@FreeBSD.org> | 2018-07-28 20:36:23 +0000 |
| commit | 1135e97b7c2c3b60fda9a6f2f4a24a8336b1024c (patch) | |
| tree | 0e0dbb798c6f8b921cdb45e02fa5baa6a6fe05d7 /sbin/init/rc.d/apmd | |
| parent | c59a544e09735f4c425b2cc5afb1b7154bd4f240 (diff) | |
Notes
Diffstat (limited to 'sbin/init/rc.d/apmd')
| -rwxr-xr-x | sbin/init/rc.d/apmd | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/sbin/init/rc.d/apmd b/sbin/init/rc.d/apmd new file mode 100755 index 000000000000..96751000a36f --- /dev/null +++ b/sbin/init/rc.d/apmd @@ -0,0 +1,38 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: apmd +# REQUIRE: DAEMON apm +# BEFORE: LOGIN +# KEYWORD: nojail shutdown + +. /etc/rc.subr + +name="apmd" +desc="Advanced power management daemon" +rcvar="apmd_enable" +command="/usr/sbin/${name}" +start_precmd="apmd_prestart" + +apmd_prestart() +{ + case `${SYSCTL_N} hw.machine_arch` in + i386) + force_depend apm || return 1 + + # Warn user about acpi apm compatibility support which + # does not work with apmd. + if [ ! -e /dev/apmctl ]; then + warn "/dev/apmctl not found; kernel is missing apm(4)" + fi + ;; + *) + return 1 + ;; + esac +} + +load_rc_config $name +run_rc_command "$1" |
