Index: DAEMON.init ================================================================== --- DAEMON.init +++ DAEMON.init @@ -1,3 +1,3 @@ # vim:ft=make: -DAEMON: pwcheck sysctl sysdb NETWORK SERVERS +DAEMON: pwcheck sysctl sysdb NETWORK SERVERS ldconfig Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -1,18 +1,19 @@ .include "/etc/mrc.conf" +.export DAEMONIZER?=svc.daemon -.MAKE.JOBS?=2 +#.MAKE.JOBS?=2 .SILENT: .include "${DAEMONIZER}" .if defined(AUTOBOOT) -SCRIPTS!=ls *.init *.service +SCRIPTS=${:!find /etc/mrc -name '*.init' -o -name '*.service'!:S/\/etc\/mrc\///} .else -SCRIPTS!=ls *.service +SCRIPTS=${:!find /etc/mrc -name '*.service'!:S/\/etc\/mrc\///} DAEMON: .endif .MAIN: ${SCRIPTS:S/.init//:S/.service//} Index: bootfs.init ================================================================== --- bootfs.init +++ bootfs.init @@ -1,5 +1,5 @@ # vim:ft=make: -bootfs: +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 || exit 0 Index: cleanvar.init ================================================================== --- cleanvar.init +++ cleanvar.init @@ -2,8 +2,8 @@ CLEANVAR_DIRS?=/var/run /var/spool/lock /var/spool/uucp/.Temp cleanvar: mount .for dir in ${CLEANVAR_DIRS} - find ${dir} -mindepth 1 -delete + test -d ${dir} && find ${dir} -mindepth 1 -delete .endfor install -m644 /dev/null /var/run/utmpx Index: dbus.service ================================================================== --- dbus.service +++ dbus.service @@ -1,11 +1,9 @@ # vim:ft=make: -DAEMON_dbus_COMMAND?=dbus-daemon +DAEMON_dbus_COMMAND?=/usr/local/bin/dbus-daemon DAEMON_dbus_ENABLE?=no DAEMON_dbus_FLAGS?=--system dbus: _daemon /usr/local/bin/dbus-uuidgen --ensure -.if !exists(/var/run/dbus) mkdir -p /var/run/dbus -.endif Index: dmesg.init ================================================================== --- dmesg.init +++ dmesg.init @@ -1,7 +1,7 @@ # vim:ft=make: -DMESG_FILE?=/var/run/dmesg/boot +DMESG_FILE?=/var/run/dmesg.boot dmesg: mountlate : Writing dmesg. umask 022 ; dmesg -a > ${DMESG_FILE} Index: dumpon.init ================================================================== --- dumpon.init +++ dumpon.init @@ -3,7 +3,7 @@ DUMPDEV?=no dumpon: random .if empty(${DUMPDEV:tl:Mno}) : Setting dumpon device. - dumpon -v ${DUMPDEV} + : dumpon -v ${DUMPDEV} .endif Index: ifconfig.init ================================================================== --- ifconfig.init +++ ifconfig.init @@ -4,7 +4,7 @@ IFCONFIG_lo0?=inet 127.0.0.1/8 up ifconfig: adjkerntz wlans : Starting interfaces. .for iface in ${IFCONFIG_IFACES} - ifconfig ${IFCONFIG_${iface}} + ifconfig ${iface} ${IFCONFIG_${iface}} .endfor Index: inetd.service ================================================================== --- inetd.service +++ inetd.service @@ -1,7 +1,7 @@ # vim:ft=make: -DAEMON_inetd_COMMAND?=inetd +DAEMON_inetd_COMMAND?=/usr/sbin/inetd DAEMON_inetd_enable?=no DAEMON_inetd_FLAGS?=-C 60 inetd: _daemon LOGIN Index: ldconfig.init ================================================================== --- ldconfig.init +++ ldconfig.init @@ -7,11 +7,11 @@ .if exists(${ldc}) ldc+=${ldc} .endif .endfor -.for dir in ${LDCONFIG_PATH_DIRS} +.for dir in ${LDCONFIG_LOCAL_DIRS} .if exists(${dir}) ldc+=${:!find ${dir} -type f!} .endif .endfor Index: mixer.init ================================================================== --- mixer.init +++ mixer.init @@ -4,8 +4,8 @@ mixer: mount cleanvar : Restoring mixer levels. .for mixer in ${mixers} .if exists(/var/db/${mixer}-state) - mixer -f ${mixer} `cat /var/db/${mixer}-state` + mixer -f /dev/${mixer} `cat /var/db/${mixer}-state` .endif .endfor Index: node_exporter.service ================================================================== --- node_exporter.service +++ node_exporter.service @@ -1,8 +1,8 @@ # vim:ft=make: -DAEMON_node_exporter_COMMAND?=node_exporter --web.listen-address=${DAEMON_node_exporter_LISTEN_ADDRESS} --collector.textfile.directory=${DAEMON_node_exporter_TEXTFILE_DIR} +DAEMON_node_exporter_COMMAND?=/usr/local/bin/node_exporter --web.listen-address=${DAEMON_node_exporter_LISTEN_ADDRESS} --collector.textfile.directory=${DAEMON_node_exporter_TEXTFILE_DIR} DAEMON_node_exporter_ENABLE?=no DAEMON_node_exporter_LISTEN_ADDRESS?=:9100 DAEMON_node_exporter_TEXTFILE_DIR?=/var/tmp/node_exporter DAEMON_node_exporter_USER?=nobody DAEMON_node_exporter_GROUP?=nobody Index: root.init ================================================================== --- root.init +++ root.init @@ -1,6 +1,6 @@ # vim:ft=make: -root: fsck +root: fsck bootfs : Mount root R/W. mount -uo rw / - umount -A + umount -a Index: slim.service ================================================================== --- slim.service +++ slim.service @@ -1,9 +1,7 @@ # vim:ft=make: -DAEMON_slim_COMMAND?=slim +DAEMON_slim_COMMAND?=/usr/local/bin/slim DAEMON_slim_ENABLE?=no slim: _daemon -.if exists(/var/run/slim.auth) rm -f /var/run/slim.auth -.endif Index: smartd.service ================================================================== --- smartd.service +++ smartd.service @@ -1,8 +1,8 @@ # vim:ft=make: -DAEMON_smartd_COMMAND?=smartd +DAEMON_smartd_COMMAND?=/usr/local/sbin/smartd DAEMON_smartd_ENABLE?=no DAEMON_smartd_FLAGS?=-c /usr/local/etc/smartd.conf -n .if !exists(/usr/local/etc/smartd.conf) DAEMON_smartd_ENABLE=no Index: sndiod.service ================================================================== --- sndiod.service +++ sndiod.service @@ -1,7 +1,7 @@ # vim:ft=make: -DAEMON_sndiod_COMMAND?=sndiod +DAEMON_sndiod_COMMAND?=/usr/local/bin/sndiod DAEMON_sndiod_ENABLE?=no DAEMON_sndiod_FLAGS?=-c 0:7 -j off -s default -m mon -s monitor -d sndiod: _daemon Index: svc.daemon ================================================================== --- svc.daemon +++ svc.daemon @@ -1,8 +1,11 @@ # vim:ft=make: -_daemon: .USE DAEMON _service +_daemon: DAEMON .USE +.if empty(${DAEMON_$@_ENABLE:tl:Mno}) + svc -u ${DAEMON_$@_USER:Uroot} -g ${DAEMON_$@_GROUP:Uwheel} init $@ ${DAEMON_$@_COMMAND} ${DAEMON_$@_FLAGS} +.endif _service: .USE .if empty(${DAEMON_$@_ENABLE:tl:Mno}) svc -u ${DAEMON_$@_USER:Uroot} -g ${DAEMON_$@_GROUP:Uwheel} init $@ ${DAEMON_$@_COMMAND} ${DAEMON_$@_FLAGS} .endif Index: watchdogd.service ================================================================== --- watchdogd.service +++ watchdogd.service @@ -1,11 +1,11 @@ # vim:ft=make: -DAEMON_watchdogd_COMMAND?=watchdogd +DAEMON_watchdogd_COMMAND?=/usr/sbin/watchdogd DAEMON_watchdogd_ENABLE?=no DAEMON_watchdogd_FLAGS?=-d -.if empty(${:!sysctl -qn debug.watchdog!}) +.if empty(${:!sysctl -qn debug.watchdog || exit 0!}) DAEMON_watchdogd_ENABLE=no .endif watchdogd: _daemon Index: wlans.init ================================================================== --- wlans.init +++ wlans.init @@ -1,12 +1,12 @@ # vim:ft=make: wlans: kld : Configuring wlans. -.for dev in ${:!sysctl -n net.wlan.devices!} -.for wlan in ${WLANS_${dev}} -.if defined(${WLANS_${wlan}_ARGS}) - ifconfig ${wlan} wlandev ${dev} ${WLANS_${wlan}_ARGS} - ifconfig ${wlan} up -.endif -.endfor -.endfor + for dev in `sysctl -n net.wlan.devices`; do \ + eval all_wlans=\$${WLANS_$${dev}}; \ + for wlan in $${all_wlans}; do \ + eval wlan_args=\$${WLANS_$${wlan}_ARGS}; \ + ifconfig $${wlan} create wlandev $${dev} $${wlan_args}; \ + ifconfig $${wlan} up; \ + done; \ + done