Browse Source

Add rc.torus

June 1 month ago
parent
commit
97b96ae311
Signed by: Curtis McEnroe <june@causal.agency> GPG Key ID: CEA2F97ADCFCD77C
2 changed files with 38 additions and 2 deletions
  1. 5
    2
      Makefile
  2. 33
    0
      rc.torus

+ 5
- 2
Makefile View File

@@ -33,13 +33,16 @@ chroot.tar: server client
33 33
 	    root/home \
34 34
 	    root/usr \
35 35
 	    root/usr/share \
36
-	    root/usr/share/misc
36
+	    root/usr/share/misc \
37
+		root/var \
38
+		root/var/run
37 39
 	install -d -o $(CHROOT_USER) -g $(CHROOT_GROUP) root/home/$(CHROOT_USER)
40
+	install -d -o $(CHROOT_USER) -g $(CHROOT_GROUP) root/var/run/torus
38 41
 	cp -a -f /usr/share/locale root/usr/share
39 42
 	cp -p -f /usr/share/misc/termcap.db root/usr/share/misc
40 43
 	cp -p -f /rescue/sh root/bin
41 44
 	install -o root -g wheel -m 555 server client root/bin
42
-	tar -c -f chroot.tar -C root bin home usr
45
+	tar -c -f chroot.tar -C root bin home usr var
43 46
 
44 47
 clean:
45 48
 	rm -f tags $(OBJS) $(BINS) chroot.tar

+ 33
- 0
rc.torus View File

@@ -0,0 +1,33 @@
1
+#!/bin/sh
2
+
3
+# PROVIDE: torus
4
+# REQUIRE: LOGIN
5
+# KEYWORD: shutdown
6
+
7
+. /etc/rc.subr
8
+
9
+name=torus
10
+rcvar=torus_enable
11
+load_rc_config ${name}
12
+
13
+: ${torus_enable:=NO}
14
+: ${torus_user=torus}
15
+: ${torus_group=${torus_user}}
16
+: ${torus_user:+${torus_chroot=/home/${torus_user}}}
17
+: ${torus_user:+${torus_data_path=/home/${torus_user}/torus.dat}}
18
+: ${torus_user:+${torus_sock_path=/home/${torus_user}/torus.sock}}
19
+torus_flags="\
20
+	${torus_data_path:+-d ${torus_data_path}} \
21
+	${torus_sock_path:+-s ${torus_sock_path}} \
22
+	${torus_flags}"
23
+
24
+torus_run=/var/run/${name}
25
+torus_pid=${torus_run}/${name}.pid
26
+
27
+required_dirs=${torus_chroot}${torus_run}
28
+pidfile=${torus_chroot}${torus_pid}
29
+
30
+command=/bin/server
31
+command_args="-p ${torus_pid}"
32
+
33
+run_rc_command "$1"

Loading…
Cancel
Save