ADDED DAEMON.init Index: DAEMON.init ================================================================== --- /dev/null +++ DAEMON.init @@ -0,0 +1,3 @@ +# vim:ft=make: + +DAEMON: pwcheck sysctl Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -1,9 +1,17 @@ .include "/etc/mrc.conf" +DAEMONIZER?=svc.daemon + +.include "${DAEMONIZER}" + .if defined(AUTOBOOT) SCRIPTS!=ls *.init *.service .else SCRIPTS!=ls *.service .endif all: ${SERVICE:S/.init//:S/.service//} + +.for file in ${SCRIPTS} +.include "${file}" +.endfor ADDED NETWORK.init Index: NETWORK.init ================================================================== --- /dev/null +++ NETWORK.init @@ -0,0 +1,3 @@ +# vim:ft=make: + +NETWORK: ifconfig ADDED SERVERS.init Index: SERVERS.init ================================================================== --- /dev/null +++ SERVERS.init @@ -0,0 +1,3 @@ +# vim:ft=make: + +SERVERS: swap ADDED devfs.init Index: devfs.init ================================================================== --- /dev/null +++ devfs.init @@ -0,0 +1,11 @@ +# vim:ft=make: + +DEVFS_CONFIG_FILES?=/etc/defaults/devfs.conf /etc/devfs.conf + +devfs: + : Applying devfs rules. +.for file in ${DEVFS_CONFIG_FILES} +.if exists(${file}) + devfsctl -a -f ${file} +.endif +.endfor ADDED dhcpcd.service Index: dhcpcd.service ================================================================== --- /dev/null +++ dhcpcd.service @@ -0,0 +1,6 @@ +# vim:ft=make: + +DAEMON_NAME=dhcpcd +DAEMON_COMMAND=dhcpcd -B + +dhcpcd: daemonize ADDED dmesg.init Index: dmesg.init ================================================================== --- /dev/null +++ dmesg.init @@ -0,0 +1,7 @@ +# vim:ft=make: + +DMESG_FILE?=/var/run/dmesg/boot + +dmesg: mountlate + : Writing dmesg. + umask 022 ; dmesg -a > ${DMESG_FILE} ADDED dntpd.service Index: dntpd.service ================================================================== --- /dev/null +++ dntpd.service @@ -0,0 +1,6 @@ +# vim:ft=make: + +DAEMON_NAME=dntpd +DAEMON_COMMAND=dntpd -F + +dntpd: daemonize ADDED dumpon.init Index: dumpon.init ================================================================== --- /dev/null +++ dumpon.init @@ -0,0 +1,9 @@ +# vim:ft=make: + +DUMPDEV?=no + +dumpon: random +.if empty(${DUMPDEV:tl:Mno}) + : Setting dumpon device. + dumpon -v ${DUMPDEV} +.endif ADDED fsck.init Index: fsck.init ================================================================== --- /dev/null +++ fsck.init @@ -0,0 +1,5 @@ +# vim:ft=make: + +fsck: + : Checking disks + fsck -p ADDED inetd.service Index: inetd.service ================================================================== --- /dev/null +++ inetd.service @@ -0,0 +1,6 @@ +# vim:ft=make: + +DAEMON_NAME=inetd +DAEMON_COMMAND=inetd -C 60 + +inetd: daemonize ADDED ldconfig.init Index: ldconfig.init ================================================================== --- /dev/null +++ ldconfig.init @@ -0,0 +1,20 @@ +# vim:ft=make: + +LDCONFIG_PATHS?=/lib /usr/lib /usr/local/lib /usr/pkg/lib +LDCONFIG_LOCAL_DIRS?=/usr/local/libdata/ldconfig + +.for ldc in ${LDCONFIG_PATHS} /etc/ld-elf.so.conf +.if exists(${ldc}) +ldc+=${ldc} +.endif +.endfor + +.for dir in ${LDCONFIG_PATH_DIRS} +.if exists(${dir}) +ldc+=${:!find ${dir} -type f!} +.endif +.endfor + +ldconfig: mountlate + : Initializing ldconfig. + ldconfig -elf ${ldc} ADDED mixer.init Index: mixer.init ================================================================== --- /dev/null +++ mixer.init @@ -0,0 +1,11 @@ +# vim:ft=make: + +mixers=${:!find /dev -name 'mixer*'!:S/\/dev\///} + +mixer: mount cleanvar + : Restoring mixer levels. +.for mixer in ${mixers} +.if exists(/var/db/${mixer}-state) + mixer -f ${mixer} `cat /var/db/${mixer}-state` +.endif +.endfor ADDED mount.init Index: mount.init ================================================================== --- /dev/null +++ mount.init @@ -0,0 +1,11 @@ +# vim:ft=make: + +NETFS_TYPES?=nfs:NFS smbfs:SMB + +excludes=${NETFS_TYPES:C/:.*//} + +mount: root + : Mount local FS. + mount -a -t no${excludes:ts,} + mount_tmpfs -m 01777 dummy /var/run/shm + mkdir -p -m 01777 /var/run/shm/tmp ADDED mountlate.init Index: mountlate.init ================================================================== --- /dev/null +++ mountlate.init @@ -0,0 +1,5 @@ +# vim:ft=make: + +mountlate: NETWORK mount cleanvar + : Mount late FS. + mount -a Index: mrc.conf ================================================================== --- mrc.conf +++ mrc.conf @@ -1,7 +1,10 @@ # vim:ft=make: +# daemonizers +# DAEMONIZER=svc.daemon + # cleanvar # CLEANVAR_DIRS=/var/run /var/spool/lock /var/spool/uucp/.Temp # random # ENTROPY_FILE=/var/db/entropy/random ADDED nextboot.init Index: nextboot.init ================================================================== --- /dev/null +++ nextboot.init @@ -0,0 +1,7 @@ +# vim:ft=make: + +nextboot: mount +.if exists(/boot/nextkernel) + : Removing nextboot setting. + rm -f /boot/nextkernel +.endif ADDED pwcheck.init Index: pwcheck.init ================================================================== --- /dev/null +++ pwcheck.init @@ -0,0 +1,7 @@ +# vim:ft=make: + +pwcheck: mountlate syslogd + : Checking password lock file. +.if exists(/etc/ptmp) + logger -s -p auth.err "password file may be incorrect -- /etc/ptmp exists" +.endif Index: random.init ================================================================== --- random.init +++ random.init @@ -1,11 +1,11 @@ # vim:ft=make: ENTROPY_FILE?=/var/db/entropy/random ENTROPY_DIR?=/var/db/entropy -random: mount +random: mount devfs : Seeding random. sysctl kern.seedenable=1 > /dev/null ( ps -fauxww; ${SYSCTL} -a; date; df -ib; dmesg; ps -fauxww; ) 2>&1 | dd status=none of=/dev/random bs=8k cat /bin/ls | dd status=none of=/dev/random bs=8k .if exists(ENTROPY_DIR) ADDED root.init Index: root.init ================================================================== --- /dev/null +++ root.init @@ -0,0 +1,6 @@ +# vim:ft=make: + +root: fsck + : Mount root R/W. + mount -uo rw / + umount -A ADDED savecore.init Index: savecore.init ================================================================== --- /dev/null +++ savecore.init @@ -0,0 +1,13 @@ +# vim:ft=make: + +DUMPDIR?=/var/crash +CRASHINFO_ENABLE?=no + +savecore: dumpon +.if empty(${DUMPDEV:tl:Mno}) && exists(${DUMPDEV}) && exists(${DUMPDIR}) + : Saving coredump. + savecore ${DUMPDIR} ${DUMPDEV} +.if empty(${CRASHINFO_ENABLE:tl:Mno}) + crashinfo -d ${DUMPDIR} +.endif +.endif ADDED svc.daemon Index: svc.daemon ================================================================== --- /dev/null +++ svc.daemon @@ -0,0 +1,4 @@ +# vim:ft=make: + +daemonize: .USE DAEMON + svc init ${DAEMON_NAME} ${DAEMON_COMMAND} ADDED swap.init Index: swap.init ================================================================== --- /dev/null +++ swap.init @@ -0,0 +1,9 @@ +# vim:ft=make: + +SWAP_ENABLED!=sysctl -n vm.swap_enabled + +swap: savecore +.if ${SWAP_ENABLED} != 0 + : Enabling swap. + swapon -a +.endif ADDED sysctl.init Index: sysctl.init ================================================================== --- /dev/null +++ sysctl.init @@ -0,0 +1,7 @@ +# vim:ft=make: + +sysctl: kld root +.if exists(/etc/sysctl.conf) + : Setting sysctl defaults. + awk '$$0~/^[ ]*(#.*)?$$/{next}{print}' < /etc/sysctl.conf | xargs -n1 sysctl +.endif