2 Commits

Author SHA1 Message Date
Jay Larson
d15b57f91f Moved to new slp format 2020-08-16 17:16:48 -05:00
Jay Larson
ef2972bf92 Updated init script 2017-05-16 13:12:58 -05:00
5 changed files with 61 additions and 51 deletions

View File

@@ -8,20 +8,21 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
DEPENDS =
DEPENDS = dash,glibc
ARCH = x86_64
URL = https://sourceforge.net/projects/acpid2/
REPO = main
BRIEF = Advanced Configuration and Power Interface event daemon
DESC = Advanced Configuration and Power Interface event daemon
SNAPVER = 1
SLVER = 3
ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1)
TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n')
SRCDIR := $(shell tar -tf $(ARCHIVE)|head -1|sed 's/\/.*//')
PATCHDIR := $(PWD)/SRC/patches
VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'|sed 's/^-//')-$(SNAPVER)
VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'|sed 's/^-//')-$(SLVER)
include /usr/share/snap/Makefile.snaplinux
include /usr/share/sl/Makefile.snaplinux
$(SRCDIR)/configure: $(ARCHIVE)
@if [ '$(TYPE)' == 'application/x-bzip2' ]; then \
@@ -63,8 +64,8 @@ $(ROOT): $(SRCDIR)/binfile
@cd $(SRCDIR) && make install DESTDIR=$(ROOT) && \
install -v -d -m 0755 $(ROOT)/etc/init.d && \
install -v -d -m 0755 $(ROOT)/etc/acpid/events && \
install -v -m 0755 $(SNAPDIR)/acpid.init $(ROOT)/etc/init.d/acpid && \
install -v -m 0644 $(SNAPDIR)/powerbutton \
install -v -m 0755 $(SLDIR)/acpid.init $(ROOT)/etc/init.d/acpid && \
install -v -m 0644 $(SLDIR)/powerbutton \
$(ROOT)/etc/acpid/events/powerbutton
test: $(ROOT)
@@ -73,7 +74,7 @@ test: $(ROOT)
clean:
@rm -rvf $(ROOT) \
$(SNAPINFO) \
$(SLINFO) \
$(MANIFEST) \
$(FILES) \
$(SRCDIR)

53
SL/acpid.init Executable file
View File

@@ -0,0 +1,53 @@
#!/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
DAEMON=/usr/sbin/acpid
PIDFILE=/var/run/acpid.pid
case "$1" in
start)
log_init_msg "Starting ACPI event daemon"
start_daemon "$DAEMON" && log_success_msg || log_failure_msg
;;
stop)
log_init_msg "Stopping ACPI event daemon"
killproc -p "$PIDFILE" "$DAEMON" -TERM && log_success_msg || log_failure_msg
;;
reload)
log_init_msg "Reloading configuration for ACPI event daemon"
killproc -p "$PIDFILE" "$DAEMON" -HUP && log_success_msg || log_failure_msg
;;
restart)
$0 stop
$0 start
;;
status)
pid=$(pidofproc -p "$PIDFILE" "$DAEMON")
if [ "$?" -ne 0 ]; then
echo "ACPI event daemon not running"
else
echo "ACPI event daemon running with PID: $pid"
fi
;;
*)
echo "Usage: $0 [start|stop|reload|restart|status]"
exit 1
;;
esac
exit 0

View File

@@ -1,44 +0,0 @@
#!/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