Overview
| Comment: | change service handling to accept multiple command names |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
cbff0b494f4c8ccf763f00450b1d2c52 |
| User & Date: | arcade on 2023-08-18 14:44:32.520 |
| Other Links: | manifest | tags |
Context
|
2023-11-04
| ||
| 08:43 | adjkerntz was grabbing open file sockets from parent check-in: 6de7ae29c1 user: arcade tags: trunk | |
|
2023-08-18
| ||
| 14:44 | change service handling to accept multiple command names check-in: cbff0b494f user: arcade tags: trunk | |
| 13:39 | bump license check-in: 2d88e848f0 user: arcade tags: trunk | |
Changes
Modified Makefile
from [2681177168]
to [5d348d4b86].
1 2 3 4 5 6 7 8 9 10 11 12 |
.include "defaults.mk"
.include "order.mk"
.include "/etc/mrc.mk"
.export
.MAKE.JOBS?= ${NCPU}
.if !empty(.MAKE.MODE:Mcompat)
.error "ERROR: MRC doesn't support "compat" mode."
.endif
OTHER_TARGETS:=
| < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | 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 41 |
.include "defaults.mk"
.include "order.mk"
.include "/etc/mrc.mk"
.export
.MAKE.JOBS?= ${NCPU}
.if !empty(.MAKE.MODE:Mcompat)
.error "ERROR: MRC doesn't support "compat" mode."
.endif
OTHER_TARGETS:=
.SILENT:
install:
install rc /etc/rc
install rc.shutdown /etc/rc.shutdown
.if defined(AUTOBOOT)
.include "init.mk"
.ERROR:
: ERROR: ABORTING BOOT (sending SIGTERM to parent)!
: target ${.ERROR_TARGET} failed to execute:
: ${.ERROR_CMD}
kill 1
.endif
test:
echo Empty target.
.include "service.mk"
.undef OTHER_TARGETS TARGETS
ENABLED:=${:!env!:C/=.*//:M*_ENABLE}
.for var in ${ENABLED}
. if !empty(${var}:tl:Mno)
#.info ${var}
. undef ${var}
|
| ︙ | ︙ |
Modified daemon.starter.mk
from [5dbcab7d1d]
to [8680d8c1bc].
1 | _service_daemon: .USE | | | | 1 2 3 4 5 6 7 8 9 |
_service_daemon: .USE
cd ${DAEMON_$@_CWD} ;\
daemon -u ${DAEMON_$@_USER} -r -P /var/run/daemon.$@.pid $${CMD} ${DAEMON_$@_FLAGS} ${DAEMON$@_FOREGROUND}
_service_daemon_status: .USE
echo "Not supported yet."
_service_daemon_exit: .USEBEFORE
kill -TERM /var/run/daemon.${@:S/_exit//}.pid
|
Modified example.service_mk
from [ee61d02d92]
to [8569a8e7e9].
1 2 3 4 5 6 7 8 | # vim:ft=make: # flags to force daemonizing DAEMON_example_BACKGROUND?= # default working directory DAEMON_example_CWD?=/some/path | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # vim:ft=make: # flags to force daemonizing DAEMON_example_BACKGROUND?= # default working directory DAEMON_example_CWD?=/some/path # command to start service, first present executable is used DAEMON_example_COMMAND?=/path/service /path/other/service # enabled by default? DAEMON_example_ENABLE?=no # general service flags DAEMON_example_FLAGS?= |
| ︙ | ︙ |
Modified init.mk
from [9ab476e53e]
to [453dce1e07].
| ︙ | ︙ | |||
213 214 215 216 217 218 219 |
.endif
NETWORK_EXIT: nfsclient_exit
netif: adjkerntz wlans cloned kld mounttmpfs utmpx
echo "MRC:$@> Starting interfaces: ${IFCONFIG_IFACES}"
.for iface in ${IFCONFIG_IFACES}
| | | | | 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
.endif
NETWORK_EXIT: nfsclient_exit
netif: adjkerntz wlans cloned kld mounttmpfs utmpx
echo "MRC:$@> Starting interfaces: ${IFCONFIG_IFACES}"
.for iface in ${IFCONFIG_IFACES}
. for item in ${IFCONFIG_${iface}:tW:ts;}
ifconfig ${iface} ${item}
. endfor
. undef _IFCONFIG_ARGS
.endfor
pf: pflogd
.if empty(PF_ENABLE:tl:Mno)
echo "MRC:$@> Enabling and loading rules."
kldload -n pf || exit 1
if [ -r ${PF_RULES} ]; then \
|
| ︙ | ︙ |
Modified plain.starter.mk
from [9946217fa1]
to [bccda73137].
1 | _service_plain: .USE | | | 1 2 3 4 5 6 7 8 |
_service_plain: .USE
chroot -u ${DAEMON_$@_USER} -g ${DAEMON_$@_GROUP} ${DAEMON_$@_CWD} $${CMD} ${DAEMON_$@_FLAGS} ${DAEMON_$@_BACKGROUND}
_service_status: .USE
echo "Plain service status doesn't work right now."
_service_exit: .USEBEFORE
echo "Plain service exit doesn't work right now."
|
Added service.mk version [abfb422fab].
Modified starter.mk
from [44086454c9]
to [435c42a9e4].
1 2 3 4 5 6 7 8 |
OTHER_TARGETS+=_service_pre
STARTER?=svc
_service_check: .USEBEFORE
# check whether service is enabled
if [ -z "$${DAEMON_$@_ENABLE}" -a -z "${FORCE}" ]; then \
exit 0 ;\
| | > > > > > > > < < > | 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 |
OTHER_TARGETS+=_service_pre
STARTER?=svc
_service_check: .USEBEFORE
# check whether service is enabled
if [ -z "$${DAEMON_$@_ENABLE}" -a -z "${FORCE}" ]; then \
exit 0 ;\
fi ;\
for CMD in ${DAEMON_$@_COMMAND}; do \
if [ -x $${CMD} ]; then \
export CMD ;\
break ;\
fi ;\
done ;\
echo $${CMD}
_service_pre: .USEBEFORE
# kldload modules if any
echo "MRC:$@> Starting service." ;\
if [ -n "${DAEMON_$@_MODULES}" ]; then \
kldload -n ${DAEMON_$@_MODULES}; \
fi
_service_post_exit: .USE
echo "MRC:${@:S/_exit//}> stopped."
|
| ︙ | ︙ |
Modified svc.starter.mk
from [8f0ec9ef40]
to [d1d5a830d6].
1 2 3 |
_service_svc: .USE
cd ${DAEMON_$@_CWD} ;\
svc list $@ | grep -q $@ || \
| | | 1 2 3 4 5 6 7 8 9 10 11 |
_service_svc: .USE
cd ${DAEMON_$@_CWD} ;\
svc list $@ | grep -q $@ || \
svc -u ${DAEMON_$@_USER} -g ${DAEMON_$@_GROUP} ${DAEMON_$@_RESTART:D-r} ${DAEMON_$@_RESTART} init $@ $${CMD} ${DAEMON_$@_FLAGS} ${DAEMON_$@_FOREGROUND}
_service_svc_status: .USE
svc status ${@:S/_status//}
_service_svc_exit: .USEBEFORE
svc list ${@:S/_exit//} | grep -q ${@:S/_exit//} || true && \
svc -s exit ${@:S/_exit//}
|
Modified wpa_supplicant.service.mk
from [f0d60a781d]
to [76f052c817].
|
| < | < < < | 1 2 3 4 5 6 |
DAEMON_wpa_supplicant_COMMAND?=/usr/local/sbin/wpa_supplicant /usr/sbin/wpa_supplicant
DAEMON_wpa_supplicant_BACKGROUND?=-B
DAEMON_wpa_supplicant_ENABLE?=no
DAEMON_wpa_supplicant_FLAGS?=-M -iwlan* -Dbsd -c/etc/wpa_supplicant.conf
wpa_supplicant: ${_SERVICE}
|