add new init scripts for multiactledPi
This commit is contained in:
parent
82f5edb31c
commit
6aeae4d533
6
Makefile
6
Makefile
@ -7,7 +7,7 @@ default: all
|
||||
|
||||
# phony rules
|
||||
.PHONY: all
|
||||
all: netledPi actledPi hddledPi
|
||||
all: netledPi actledPi hddledPi multiactledPi
|
||||
|
||||
netledPi:
|
||||
$(CC) $(CFLAGS) -o netledPi netledPi.c
|
||||
@ -18,7 +18,9 @@ hddledPi:
|
||||
actledPi:
|
||||
$(CC) $(CFLAGS) -o actledPi actledPi.c
|
||||
|
||||
multiactledPi:
|
||||
$(CC) $(CFLAGS) -o multiactledPi multiactledPi.c
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@rm -f *.o netledPi hddledPi actledPi
|
||||
@rm -f *.o netledPi hddledPi actledPi multiactledPi
|
||||
|
48
initscripts/sysVinit/multiactledPi
Normal file
48
initscripts/sysVinit/multiactledPi
Normal file
@ -0,0 +1,48 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: multiactledPi
|
||||
# Required-Start: $local_fs
|
||||
# Required-Stop:
|
||||
# Should-Start:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop:
|
||||
# Short-Description: Start the multiactledPi daemon
|
||||
# Description: A daemon that blinks LEDs connected to GPIO pins on disk and network activity
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin
|
||||
NAME=multiactledPi
|
||||
DESC="Disk and network activity lights"
|
||||
# Define LSB log_* functions.
|
||||
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
|
||||
. /lib/lsb/init-functions
|
||||
. /lib/init/vars.sh
|
||||
|
||||
do_start () {
|
||||
# Start disk activity light
|
||||
log_daemon_msg "Starting $DESC" "$NAME"
|
||||
multiactledPi -d -r 20
|
||||
log_end_msg $?
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
start|"")
|
||||
do_start
|
||||
;;
|
||||
restart|reload|force-reload)
|
||||
echo "Error: argument '$1' not supported" >&2
|
||||
exit 3
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
killall multiactledPi
|
||||
log_end_msg $?
|
||||
;;
|
||||
*)
|
||||
echo "Usage: multiactledPi [start|stop]" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
|
||||
:
|
@ -3,7 +3,7 @@ Description=hddledPi mass storage activity indicator
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
ExecStart=/usr/local/bin/hddledPi -d
|
||||
ExecStart=/usr/bin/hddledPi -d
|
||||
|
||||
[Install]
|
||||
WantedBy=basic.target
|
||||
|
10
initscripts/systemd/multiactledPi.service
Normal file
10
initscripts/systemd/multiactledPi.service
Normal file
@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=multiactledPi disk and network activity indicator
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
ExecStart=/usr/bin/multiactledPi -d
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
@ -4,7 +4,7 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
ExecStart=/usr/local/bin/netledPi -d
|
||||
ExecStart=/usr/bin/netledPi -d
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
|
Loading…
Reference in New Issue
Block a user