45 lines
983 B
Bash
Executable File
45 lines
983 B
Bash
Executable File
#!/bin/sh
|
|
### BEGIN INIT INFO
|
|
# Provides: acpid
|
|
# Required-Start: $remote_fs $syslog
|
|
# Required-Stop: $remote_fs $syslog
|
|
# Should-Start:
|
|
# Should-Stop
|
|
# Default-Start: 2 3 4 5
|
|
# Default-Stop: 0 1 6
|
|
# Short-Description: Advanced Configuration and Power Interface event daemon
|
|
### END INIT INFO
|
|
|
|
. /lib/lsb/init-functions
|
|
|
|
case "$1" in
|
|
start)
|
|
log_info_msg "Starting ACPI event daemon"
|
|
|
|
pidofproc -p /run/acpid.pid > /dev/null && \
|
|
echo -n " acpid already running" && log_warning_msg
|
|
|
|
start_daemon /usr/sbin/acpid -p /run/acpid.pid && \
|
|
log_success_msg || log_failure_msg
|
|
;;
|
|
stop)
|
|
log_info_msg "Stopping ACPI event daemon"
|
|
killproc -p "/run/acpid.pid" /usr/sbin/acpid && \
|
|
log_success_msg || log_failure_msg
|
|
;;
|
|
restart)
|
|
$0 stop
|
|
sleep 1
|
|
$0 start
|
|
;;
|
|
status)
|
|
statusproc /usr/sbin/acpid
|
|
;;
|
|
*)
|
|
echo "Usage: $0 [start|stop|restart|status]"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|