diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | Makefile | 10 | ||||
| -rw-r--r-- | README.md | 3 | ||||
| -rw-r--r-- | burstdog.rc.in | 4 |
4 files changed, 17 insertions, 1 deletions
@@ -1,2 +1,3 @@ burstdog burstdog.log +burstdog.rc @@ -1,10 +1,18 @@ CFLAGS = -O3 -Wall -Wextra PREFIX = /usr/local +all: burstdog burstdog.rc + burstdog: burstdog.c $(CC) $(CFLAGS) burstdog.c -o burstdog +burstdog.rc: burstdog.rc.in + sed 's#%BINPATH%#$(PREFIX)/bin#g' burstdog.rc.in > burstdog.rc + install: burstdog install -Dm 755 burstdog "$(PREFIX)/bin/burstdog" -.PHONY: install +install-rc: burstdog.rc install + install -Dm 755 burstdog.rc /etc/init.d/burstdog + +.PHONY: install install-rc @@ -10,6 +10,8 @@ burstdog [logfile] Default logfile is `burstdog.log` in the current directory. +The openrc service logs to `/var/log/burstdog.log`. + ## Build Compile using `make` or `cc burstdog.c -O3 -o burstdog`. @@ -17,6 +19,7 @@ Compile using `make` or `cc burstdog.c -O3 -o burstdog`. See [burstdog.c](burstdog.c) for configuration options. Install to PREFIX using `make install`. +To install openrc service file, use `make install-rc`. ## Test burstdog diff --git a/burstdog.rc.in b/burstdog.rc.in new file mode 100644 index 0000000..7e2132a --- /dev/null +++ b/burstdog.rc.in @@ -0,0 +1,4 @@ +#!/sbin/openrc-run +supervisor=supervise-daemon +command=%BINPATH%/burstdog +command_args=/var/log/burstdog.log |
