Lines of
starter.mk
from check-in cbff0b494f
that are changed by the sequence of edits moving toward
check-in adf4eb9997:
1: OTHER_TARGETS+=_service_pre
2:
3: STARTER?=svc
4:
5: _service_check: .USEBEFORE
6: # check whether service is enabled
7: if [ -z "$${DAEMON_$@_ENABLE}" -a -z "${FORCE}" ]; then \
8: exit 0 ;\
cbff0b494f 2023-08-18 9: fi ;\
cbff0b494f 2023-08-18 10: for CMD in ${DAEMON_$@_COMMAND}; do \
cbff0b494f 2023-08-18 11: if [ -x $${CMD} ]; then \
cbff0b494f 2023-08-18 12: export CMD ;\
13: break ;\
14: fi ;\
cbff0b494f 2023-08-18 15: done ;\
cbff0b494f 2023-08-18 16: echo $${CMD}
17:
18: _service_pre: .USEBEFORE
19: # kldload modules if any
20: echo "MRC:$@> Starting service." ;\
21: if [ -n "${DAEMON_$@_MODULES}" ]; then \
22: kldload -n ${DAEMON_$@_MODULES}; \
23: fi
24:
25: _service_post_exit: .USE
26: echo "MRC:${@:S/_exit//}> stopped."
27:
28: .for starter_source in ${:!find /etc/mrc -name '*.starter.mk'!:S/\/etc\/mrc\///}
29: starter:=${starter_source:S/.starter.mk$//}
30: Starter:=${starter:tu}
31:
32: OTHER_TARGETS:=${OTHER_TARGETS} _service_${starter} _service_${starter}_exit _service_${starter}_status
33:
34: _SERVICE_${Starter}:=_service_pre DAEMON _service_${starter} _service_check
35: _EARLYSERVICE_${Starter}:=_service_pre SERVICE _service_${starter} _service_check
36: _SERVICE_${Starter}_EXIT:=_service_${starter}_exit _service_post_exit
37:
38: .if "${STARTER}" == "${starter}"
39: _SERVICE:=_service_pre DAEMON _service_${starter} _service_check
40: _EARLYSERVICE:=_service_pre SERVICE _service_${starter} _service_check
41: _SERVICE_EXIT:=_service_${starter}_exit _service_post_exit
42: .endif
43:
44: .export
45: .include "${starter_source}"
46: .endfor