Index: DAEMON.init ================================================================== --- DAEMON.init +++ DAEMON.init @@ -1,3 +1,3 @@ # vim:ft=make: -DAEMON: pwcheck sysctl sysdb NETWORK SERVERS ldconfig +DAEMON: pwcheck sysctl sysdb NETWORK SERVERS ldconfig nfsclient Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -32,40 +32,39 @@ NETWORK: SERVERS: -mountlate: mount cleanvar - -mount: - -cleanvar: mount - -nfsclient: NETWORK +SERVICE: .endif +test: + echo Empty target. + TARGETS:=${SCRIPTS:S/.init//:S/.service//} .MAIN: ${TARGETS} .PHONY: ${TARGETS} ${OTHER_TARGETS} .undef TARGETS OTHER_TARGETS .for file in ${SCRIPTS} -.info ${file} +#.info ${file} .include "${file}" .endfor .undef SCRIPTS ENABLED=${:!env!:C/=.*//:M*_ENABLE} .for var in ${ENABLED} .if !empty(${var}:tl:Mno) -#.info ${var} +.info ${var} .undef ${var} -.unexport ${var} .endif .endfor .undef ENABLED +.unexport-env +.export +.info ${:!env!} ADDED SERVICE.init Index: SERVICE.init ================================================================== --- /dev/null +++ SERVICE.init @@ -0,0 +1,1 @@ +SERVICE: ifconfig mount random hostname cleanvar Index: automountd.service ================================================================== --- automountd.service +++ automountd.service @@ -2,8 +2,8 @@ DAEMON_automountd_COMMAND?=/usr/sbin/autmountd DAEMON_automountd_ENABLE?=no DAEMON_automountd_MODULES=autofs -automountd: _daemon nfsclient +automountd: _daemon # nfsclient -> DAEMON .export DAEMON_$@_ENABLE test -z "$${DAEMON_$@_ENABLE}" || /usr/sbin/automount Index: bootfs.init ================================================================== --- bootfs.init +++ bootfs.init @@ -1,5 +1,5 @@ # vim:ft=make: bootfs: fsck : Checking whether we need /boot mounted. - mount -vadr | grep -q ' /boot$$' && mount -r /boot || exit 0 + mount -vadr | grep -q ' /boot$$' && mount -r /boot || true Index: devd.service ================================================================== --- devd.service +++ devd.service @@ -3,7 +3,6 @@ DAEMON_devd_COMMAND?=/sbin/devd DAEMON_devd_ENABLE?=yes DAEMON_devd_FLAGS?=-dq devd: _service -.export DAEMON_$@_ENABLE - test -z "$${DAEMON_$@_ENABLE}" || sysctl hw.bus.devctl_disable=1 + test -n "$${DAEMON_$@_ENABLE}" || sysctl hw.bus.devctl_disable=1 Index: dhcpcd.service ================================================================== --- dhcpcd.service +++ dhcpcd.service @@ -2,6 +2,6 @@ DAEMON_dhcpcd_COMMAND?=/sbin/dhcpcd DAEMON_dhcpcd_ENABLE?=no DAEMON_dhcpcd_FLAGS?=-B -dhcpcd: _service mount cleanvar NETWORK +dhcpcd: _service NETWORK SERVICE # mount -> SERVICE, cleanvar -> SERVICE ADDED mountd.service Index: mountd.service ================================================================== --- /dev/null +++ mountd.service @@ -0,0 +1,16 @@ +# vim:ft=make: + +DAEMON_mountd_COMMAND?=/sbin/mountd +DAEMON_mountd_ENABLE?=no +DAEMON_mountd_FLAGS?=-r + +.if empty(DAEMON_mountd_ENABLE:tl:Mno) +DAEMON_rpcbind_ENABLE=yes +.endif + +mountd: rpcbind NETWORK SERVERS _service # mountlate -> SERVERS +.export DAEMON_$@_ENABLE + test -z "$${DAEMON_$@_ENABLE}" || { \ + rm -f /var/db/mountdtab; \ + ( umask 022 ; touch /var/db/mountdtab ); \ + } ADDED nfsclient.init Index: nfsclient.init ================================================================== --- /dev/null +++ nfsclient.init @@ -0,0 +1,11 @@ +# vim:ft=make: + +NFSCLIENT_ENABLE?=no + +.if empty(NFSCLIENT_ENABLE:tl:Mno) +DAEMON_rpcbind_ENABLE=yes +.endif + +nfsclient: NETWORK rpcbind rpc_umntall +.export NFSCLIENT_ENABLE + test -z "$${NFSCLIENT_ENABLE}" || kldload -n nfs ADDED nfsd.service Index: nfsd.service ================================================================== --- /dev/null +++ nfsd.service @@ -0,0 +1,15 @@ +# vim:ft=make: + +DAEMON_nfsd_COMMAND?=/sbin/nfsd +DAEMON_nfsd_ENABLE?=no +DAEMON_nfsd_FLAGS?=-u -t -n 4 + +.if empty(DAEMON_nfsd_ENABLE:tl:Mno) +DAEMON_rpcbind_ENABLE=yes +DAEMON_mountd_ENABLE=yes +.endif + +nfsd: mountd _service rpcbind +.if empty(NFS_RESERVED_PORT_ONLY:tl:Mno) + sysctl vfs.nfs.nfs_privport=1 +.endif ADDED rpc_umntall.init Index: rpc_umntall.init ================================================================== --- /dev/null +++ rpc_umntall.init @@ -0,0 +1,7 @@ +# vim:ft=make: + +rpc_umntall: mountlate NETWORK rpcbind +.if empty(RPC_UMNTALL_ENABLE:tl:Mno) + test -f /var/db/mounttab || true && \ + rpc.umntall -k & +.endif ADDED rpcbind.service Index: rpcbind.service ================================================================== --- /dev/null +++ rpcbind.service @@ -0,0 +1,7 @@ +# vim:ft=make: + +DAEMON_rpcbind_COMMAND?=/usr/sbin/rpcbind +DAEMON_rpcbind_ENABLE?=no +DAEMON_rpcbind_FLAGS?=-d + +rpcbind: _service NETWORK syslogd Index: svc.daemon.mk ================================================================== --- svc.daemon.mk +++ svc.daemon.mk @@ -3,11 +3,11 @@ .if ${DAEMONIZER} == "svc" LOCAL_TARGETS:=${LOCAL_TARGETS} ${LOCAL_TARGETS:S/_svc//} .endif .for target in ${LOCAL_TARGETS} -${target}: ${target:M_daemon:DDAEMON} .USE +${target}: ${target:C/_daemon.*/DAEMON/:C/_service.*/SERVICE/} .USE #.export DAEMON_$@_ENABLE env | grep $@ test -z "$${DAEMON_$@_ENABLE}" || { \ test -n "${DAEMON_$@_MODULES}" && kldload -n ${DAEMON_$@_MODULES} || true; \ svc -u ${DAEMON_$@_USER:Uroot} -g ${DAEMON_$@_GROUP:Uwheel} init $@ ${DAEMON_$@_COMMAND} ${DAEMON_$@_FLAGS}; \