Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -1,9 +1,9 @@ .include "defaults.mk" .include "order.mk" .include "/etc/mrc.mk" -.export +.export-all .MAKE.JOBS?= ${NCPU} .if !empty(.MAKE.MODE:Mcompat) .error "ERROR: MRC doesn't support "compat" mode." .endif @@ -42,7 +42,7 @@ . endif .endfor .undef ENABLED .unexport-env -.export +.export-all #.info ${:!env!} Index: dbus.service.mk ================================================================== --- dbus.service.mk +++ dbus.service.mk @@ -1,7 +1,7 @@ DAEMON_dbus_COMMAND?=/usr/local/bin/dbus-daemon -DAEMON_dbus_FLAGS?=--system --syslog +DAEMON_dbus_FLAGS?=--system --syslog --print-address DAEMON_dbus_BACKGROUND?=--fork DAEMON_dbus_FOREGROUND?=--nofork --nopidfile dbus: ${_SERVICE} mkdir -p /var/run/dbus /var/lib/dbus Index: plain.starter.mk ================================================================== --- plain.starter.mk +++ plain.starter.mk @@ -1,8 +1,8 @@ _service_plain: .USE chroot -u ${DAEMON_$@_USER} -g ${DAEMON_$@_GROUP} ${DAEMON_$@_CWD} $${CMD} ${DAEMON_$@_FLAGS} ${DAEMON_$@_BACKGROUND} -_service_status: .USE +_service_plain_status: .USE echo "Plain service status doesn't work right now." -_service_exit: .USEBEFORE - echo "Plain service exit doesn't work right now." +_service_plain_exit: .USEBEFORE + export CMD="chroot -u ${DAEMON_$@_USER} -g ${DAEMON_$@_GROUP} ${DAEMON_$@_CWD} $${CMD} ${DAEMON_$@_FLAGS}" Index: starter.mk ================================================================== --- starter.mk +++ starter.mk @@ -17,10 +17,12 @@ # bail out if binary not found if [ -z $${CMD} ]; then \ echo "MRC:$@> Executable not found." ;\ exit 0 ;\ fi + +_service_check_start: .USEBEFORE # check for rtprio/idprio if [ -n "$${DAEMON_$@_IDPRIO}" ]; then \ export CMD="/usr/sbin/idprio $${DAEMON_$@_IDPRIO} $${CMD}" ;\ elif [ -n "$${DAEMON_$@_RTPRIO}" ]; then \ export CMD="/usr/sbin/rtprio $${DAEMON_$@_RTPRIO} $${CMD}" ;\ @@ -45,18 +47,18 @@ # here we are inheriting pieces of different targets into one single target, so # everything is appended in the order, but gets organized a little bit # differently, all targets with .USEBEFORE are added before current target # script, so after "_service_pre _service_check" we got that order inverted -_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 +_SERVICE_${Starter}:=_service_pre DAEMON _service_${starter} _service_check_start _service_check +_EARLYSERVICE_${Starter}:=_service_pre SERVICE _service_${starter} _service_check_start _service_check +_SERVICE_${Starter}_EXIT:=_service_${starter}_exit _service_post_exit _service_check . if "${STARTER}" == "${starter}" -_SERVICE:=_service_pre DAEMON _service_${starter} _service_check -_EARLYSERVICE:=_service_pre SERVICE _service_${starter} _service_check -_SERVICE_EXIT:=_service_${starter}_exit _service_post_exit +_SERVICE:=${_SERVICE_${Starter}} +_EARLYSERVICE:=${_EARLYSERVICE_${Starter}} +_SERVICE_EXIT:=${_SERVICE_${Starter}_EXIT} . endif -. export +. export-all . include "${starter_source}" .endfor Index: svc.starter.mk ================================================================== --- svc.starter.mk +++ svc.starter.mk @@ -5,8 +5,8 @@ _service_svc_status: .USE svc status ${@:S/_status//} _service_svc_exit: .USEBEFORE - #svc list ${@:S/_exit//} | grep -q ${@:S/_exit//} || true && + svc list ${@:S/_exit//} | grep -q ${@:S/_exit//} || true && \ lockf -kst 0 /var/run/service.${@:S/_exit//}.pid svc -t 0 kill ${@:S/_exit//} || \ svc -s exit ${@:S/_exit//} > /dev/null