add new init scripts for multiactledPi

This commit is contained in:
John D. Martin III 2021-03-09 00:26:53 -05:00
parent 82f5edb31c
commit 6aeae4d533
5 changed files with 64 additions and 4 deletions

View File

@ -7,7 +7,7 @@ default: all
# phony rules # phony rules
.PHONY: all .PHONY: all
all: netledPi actledPi hddledPi all: netledPi actledPi hddledPi multiactledPi
netledPi: netledPi:
$(CC) $(CFLAGS) -o netledPi netledPi.c $(CC) $(CFLAGS) -o netledPi netledPi.c
@ -18,7 +18,9 @@ hddledPi:
actledPi: actledPi:
$(CC) $(CFLAGS) -o actledPi actledPi.c $(CC) $(CFLAGS) -o actledPi actledPi.c
multiactledPi:
$(CC) $(CFLAGS) -o multiactledPi multiactledPi.c
.PHONY: clean .PHONY: clean
clean: clean:
@rm -f *.o netledPi hddledPi actledPi @rm -f *.o netledPi hddledPi actledPi multiactledPi

View 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
:

View File

@ -3,7 +3,7 @@ Description=hddledPi mass storage activity indicator
[Service] [Service]
Type=forking Type=forking
ExecStart=/usr/local/bin/hddledPi -d ExecStart=/usr/bin/hddledPi -d
[Install] [Install]
WantedBy=basic.target WantedBy=basic.target

View 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

View File

@ -4,7 +4,7 @@ After=network.target
[Service] [Service]
Type=forking Type=forking
ExecStart=/usr/local/bin/netledPi -d ExecStart=/usr/bin/netledPi -d
[Install] [Install]
WantedBy=default.target WantedBy=default.target