diff --git a/Makefile b/Makefile index 38e5d0e..1b09e3c 100644 --- a/Makefile +++ b/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 diff --git a/initscripts/sysVinit/multiactledPi b/initscripts/sysVinit/multiactledPi new file mode 100644 index 0000000..7da09b2 --- /dev/null +++ b/initscripts/sysVinit/multiactledPi @@ -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 + +: diff --git a/initscripts/systemd/hddledPi.service b/initscripts/systemd/hddledPi.service index 7d5446d..717595c 100644 --- a/initscripts/systemd/hddledPi.service +++ b/initscripts/systemd/hddledPi.service @@ -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 diff --git a/initscripts/systemd/multiactledPi.service b/initscripts/systemd/multiactledPi.service new file mode 100644 index 0000000..bfebe98 --- /dev/null +++ b/initscripts/systemd/multiactledPi.service @@ -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 diff --git a/initscripts/systemd/netledPi.service b/initscripts/systemd/netledPi.service index 72a7c63..5815423 100644 --- a/initscripts/systemd/netledPi.service +++ b/initscripts/systemd/netledPi.service @@ -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