Diff
Logged in as anonymous

Differences From Artifact [d6bb3354cb]:

To Artifact [bc7d3b9e6c]:


1
2
3
4
5

6
7
8
9



10
11
12
13
14
15




16
17
18
19
20
21
22
23
24
25



26
27
28
29
30



31
32
33
34
35
1
2
3
4

5
6
7
8

9
10
11
12
13
14
15
16

17
18
19
20
21
22
23
24
25
26
27



28
29
30
31
32



33
34
35
36
37
38
39
40




-
+



-
+
+
+





-
+
+
+
+







-
-
-
+
+
+


-
-
-
+
+
+





OTHER_TARGETS+=_service_pre

STARTER?=svc

_service_pre: .USEBEFORE
_service_check: .USEBEFORE
	# check whether service is enabled
	if [ -z "$${DAEMON_$@_ENABLE}" ]; then \
		exit 0; \
	fi; \
	fi

_service_pre: .USEBEFORE
	echo "MRC:$@> Starting service."

	# kldload modules if any
	if [ -n "${DAEMON_$@_MODULES}" ]; then \
		kldload -n ${DAEMON_$@_MODULES}; \
	fi; \
	fi

_service_post_exit: .USE
	echo "MRC:${@:S/_exit//}> stopped."

.for starter_source in ${:!find /etc/mrc -name '*.starter.mk'!:S/\/etc\/mrc\///}
starter:=${starter_source:S/.starter.mk$//}
Starter:=${starter:tu}

OTHER_TARGETS:=${OTHER_TARGETS} _service_${starter} _service_${starter}_exit _service_${starter}_status

_SERVICE_${Starter}:=_service_pre DAEMON _service_${starter}
_EARLYSERVICE_${Starter}:=_service_pre SERVICE _service_${starter}
_SERVICE_${Starter}_EXIT:=_service_${starter}_exit
_SERVICE_${Starter}:=_service_pre DAEMON _service_${starter} _service_check
_EARLYSERVICE_${Starter}:=_service_pre SERVICE _service_${starter} _service_check
_SERVICE_${Starter}_EXIT:=_service_${starter}_exit _service_post_exit

.if "${STARTER}" == "${starter}"
_SERVICE:=_service_pre DAEMON _service_${starter}
_EARLYSERVICE:=_service_pre SERVICE _service_${starter}
_SERVICE_EXIT:=_service_${starter}_exit
_SERVICE:=_service_pre DAEMON _service_${starter} _service_check
_EARLYSERVICE:=_service_pre SERVICE _service_${starter} _service_check
_SERVICE_EXIT:=_service_${starter}_exit _service_post_exit
.endif

.export
.include "${starter_source}"
.endfor