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