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