From aa3a9210c11813b44813aaba50e1671caf4ed871 Mon Sep 17 00:00:00 2001 From: Lizzy Fleckenstein Date: Wed, 1 Apr 2026 22:31:01 +0200 Subject: add openrc service --- .gitignore | 1 + Makefile | 10 +++++++++- README.md | 3 +++ burstdog.rc.in | 4 ++++ 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 burstdog.rc.in diff --git a/.gitignore b/.gitignore index 711446a..c3fb617 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ burstdog burstdog.log +burstdog.rc diff --git a/Makefile b/Makefile index e578636..fdd9081 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index 005e299..932c99b 100644 --- a/README.md +++ b/README.md @@ -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 -- cgit v1.2.3