summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rwxr-xr-xrc.d-jaildaemon28
2 files changed, 34 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 4db0245..ef6a9b5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,14 @@
1CFLAGS+=-Wall -Wextra -pedantic -Os 1CFLAGS+=-Wall -Wextra -pedantic -Os
2LDFLAGS+=-s
3PREFIX?=/usr/local
2 4
3jaildaemon: jaildaemon.c 5jaildaemon: jaildaemon.c
4 $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS) 6 $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
5 7
8install: jaildaemon
9 install -o 0 -g 0 -m 0755 jaildaemon $(PREFIX)/bin
10 install -o 0 -g 0 -m 0755 rc.d-jaildaemon $(PREFIX)/etc/rc.d/jaildaemon
11
6.PHONY: clean test 12.PHONY: clean test
7clean: 13clean:
8 rm -f jaildaemon 14 rm -f jaildaemon
diff --git a/rc.d-jaildaemon b/rc.d-jaildaemon
new file mode 100755
index 0000000..9eb8268
--- /dev/null
+++ b/rc.d-jaildaemon
@@ -0,0 +1,28 @@
1#!/bin/sh
2# $Id$
3#
4# $FreeBSD$
5#
6# PROVIDE: jaildaemon
7# REQUIRE: cleanvar
8# BEFORE: ezjail
9# KEYWORD: nojail shutdown
10#
11# Add the following lines to /etc/rc.conf.local or /etc/rc.conf to enable jaildaemon
12#
13#jaildaemon_enable="YES"
14
15
16. /etc/rc.subr
17
18name="jaildaemon"
19rcvar="jaildaemon_enable"
20pidfile="/var/run/${name}.pid"
21command="/usr/local/bin/${name}"
22
23jaildaemon_flags="-D -p ${pidfile}"
24
25: ${jaildaemon_enable:=no}
26
27load_rc_config $name
28run_rc_command "$1"