Check-in [8f80b79392]
Logged in as anonymous
Overview
Comment:fixing a lot of bugs
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8f80b79392cf027c6f1cb633fce649d1555515afe6d7772704046faf5402ea1c
User & Date: arcade on 2019-10-20 09:39:12.062
Other Links: manifest | tags
Context
2019-10-20
10:10
fix cleanvar and race around /var/run/shm check-in: 2bf099898d user: arcade tags: trunk
09:39
fixing a lot of bugs check-in: 8f80b79392 user: arcade tags: trunk
00:53
add devd check-in: bf6ae1479b user: arcade tags: trunk
Changes
1
2
3
# vim:ft=make:

DAEMON: pwcheck sysctl sysdb NETWORK SERVERS


|
1
2
3
# vim:ft=make:

DAEMON: pwcheck sysctl sysdb NETWORK SERVERS ldconfig
Modified Makefile from [9fb89ad753] to [33959c3113].
1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
.include "/etc/mrc.conf"


DAEMONIZER?=svc.daemon

.MAKE.JOBS?=2
.SILENT:

.include "${DAEMONIZER}"

.if defined(AUTOBOOT)
SCRIPTS!=ls *.init *.service
.else
SCRIPTS!=ls *.service

DAEMON:
.endif

.MAIN: ${SCRIPTS:S/.init//:S/.service//}

.PHONY: ${SCRIPTS:S/.init//:S/.service//} _daemon _service

>



|





|

|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
.include "/etc/mrc.conf"
.export

DAEMONIZER?=svc.daemon

#.MAKE.JOBS?=2
.SILENT:

.include "${DAEMONIZER}"

.if defined(AUTOBOOT)
SCRIPTS=${:!find /etc/mrc -name '*.init' -o -name '*.service'!:S/\/etc\/mrc\///}
.else
SCRIPTS=${:!find /etc/mrc -name '*.service'!:S/\/etc\/mrc\///}

DAEMON:
.endif

.MAIN: ${SCRIPTS:S/.init//:S/.service//}

.PHONY: ${SCRIPTS:S/.init//:S/.service//} _daemon _service
1
2
3
4
5
# vim:ft=make:

bootfs:
	: Checking whether we need /boot mounted.
	mount -vadr | grep -q ' /boot$' && mount -r /boot || exit 0


|

|
1
2
3
4
5
# vim:ft=make:

bootfs: fsck
	: Checking whether we need /boot mounted.
	mount -vadr | grep -q ' /boot$$' && mount -r /boot || exit 0
1
2
3
4
5
6
7
8
9
# vim:ft=make:

CLEANVAR_DIRS?=/var/run /var/spool/lock /var/spool/uucp/.Temp

cleanvar: mount
.for dir in ${CLEANVAR_DIRS}
	find ${dir} -mindepth 1 -delete
.endfor
	install -m644 /dev/null /var/run/utmpx






|


1
2
3
4
5
6
7
8
9
# vim:ft=make:

CLEANVAR_DIRS?=/var/run /var/spool/lock /var/spool/uucp/.Temp

cleanvar: mount
.for dir in ${CLEANVAR_DIRS}
	test -d ${dir} && find ${dir} -mindepth 1 -delete
.endfor
	install -m644 /dev/null /var/run/utmpx
1
2
3
4
5
6
7
8
9
10
11
# vim:ft=make:

DAEMON_dbus_COMMAND?=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


|





<

<
1
2
3
4
5
6
7
8

9

# vim:ft=make:

DAEMON_dbus_COMMAND?=/usr/local/bin/dbus-daemon
DAEMON_dbus_ENABLE?=no
DAEMON_dbus_FLAGS?=--system

dbus: _daemon
	/usr/local/bin/dbus-uuidgen --ensure

	mkdir -p /var/run/dbus

1
2
3
4
5
6
7
# vim:ft=make:

DMESG_FILE?=/var/run/dmesg/boot

dmesg: mountlate
	: Writing dmesg.
	umask 022 ; dmesg -a > ${DMESG_FILE}


|




1
2
3
4
5
6
7
# vim:ft=make:

DMESG_FILE?=/var/run/dmesg.boot

dmesg: mountlate
	: Writing dmesg.
	umask 022 ; dmesg -a > ${DMESG_FILE}
1
2
3
4
5
6
7
8
9
# vim:ft=make:

DUMPDEV?=no

dumpon: random
.if empty(${DUMPDEV:tl:Mno})
	: Setting dumpon device.
	dumpon -v ${DUMPDEV}
.endif







|

1
2
3
4
5
6
7
8
9
# vim:ft=make:

DUMPDEV?=no

dumpon: random
.if empty(${DUMPDEV:tl:Mno})
	: Setting dumpon device.
	: dumpon -v ${DUMPDEV}
.endif
1
2
3
4
5
6
7
8
9
10
# vim:ft=make:

IFCONFIG_IFACES?=lo0
IFCONFIG_lo0?=inet 127.0.0.1/8 up

ifconfig: adjkerntz wlans
	: Starting interfaces.
.for iface in ${IFCONFIG_IFACES}
	ifconfig ${IFCONFIG_${iface}}
.endfor








|

1
2
3
4
5
6
7
8
9
10
# vim:ft=make:

IFCONFIG_IFACES?=lo0
IFCONFIG_lo0?=inet 127.0.0.1/8 up

ifconfig: adjkerntz wlans
	: Starting interfaces.
.for iface in ${IFCONFIG_IFACES}
	ifconfig ${iface} ${IFCONFIG_${iface}}
.endfor
1
2
3
4
5
6
7
# vim:ft=make:

DAEMON_inetd_COMMAND?=inetd
DAEMON_inetd_enable?=no
DAEMON_inetd_FLAGS?=-C 60

inetd: _daemon LOGIN


|




1
2
3
4
5
6
7
# vim:ft=make:

DAEMON_inetd_COMMAND?=/usr/sbin/inetd
DAEMON_inetd_enable?=no
DAEMON_inetd_FLAGS?=-C 60

inetd: _daemon LOGIN
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 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.











|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 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_LOCAL_DIRS}
.if exists(${dir})
ldc+=${:!find ${dir} -type f!}
.endif
.endfor

ldconfig: mountlate
	: Initializing ldconfig.
1
2
3
4
5
6
7
8
9
10
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








|


1
2
3
4
5
6
7
8
9
10
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 /dev/${mixer} `cat /var/db/${mixer}-state`
.endif
.endfor
1
2
3
4
5
6
7
8
9
10
# 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_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

node_exporter: _daemon


|







1
2
3
4
5
6
7
8
9
10
# vim:ft=make:

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

node_exporter: _daemon
Modified root.init from [8148072579] to [398ba3c8e7].
1
2
3
4
5
6
# vim:ft=make:

root: fsck
	: Mount root R/W.
	mount -uo rw /
	umount -A


|


|
1
2
3
4
5
6
# vim:ft=make:

root: fsck bootfs
	: Mount root R/W.
	mount -uo rw /
	umount -a
1
2
3
4
5
6
7
8
9
# vim:ft=make:

DAEMON_slim_COMMAND?=slim
DAEMON_slim_ENABLE?=no

slim: _daemon
.if exists(/var/run/slim.auth)
	rm -f /var/run/slim.auth
.endif


|



<

<
1
2
3
4
5
6

7

# vim:ft=make:

DAEMON_slim_COMMAND?=/usr/local/bin/slim
DAEMON_slim_ENABLE?=no

slim: _daemon

	rm -f /var/run/slim.auth

1
2
3
4
5
6
7
8
9
10
# vim:ft=make:

DAEMON_smartd_COMMAND?=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
.info smartd requires config file to start
.endif


|







1
2
3
4
5
6
7
8
9
10
# vim:ft=make:

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
.info smartd requires config file to start
.endif
1
2
3
4
5
6
7
# vim:ft=make:

DAEMON_sndiod_COMMAND?=sndiod
DAEMON_sndiod_ENABLE?=no
DAEMON_sndiod_FLAGS?=-c 0:7 -j off -s default -m mon -s monitor -d

sndiod: _daemon


|




1
2
3
4
5
6
7
# vim:ft=make:

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
1
2
3



4
5
6
7
8
# vim:ft=make:

_daemon: .USE DAEMON _service




_service: .USE
.if empty(${DAEMON_$@_ENABLE:tl:Mno})
	svc -u ${DAEMON_$@_USER:Uroot} -g ${DAEMON_$@_GROUP:Uwheel} init $@ ${DAEMON_$@_COMMAND} ${DAEMON_$@_FLAGS}
.endif


|
>
>
>





1
2
3
4
5
6
7
8
9
10
11
# vim:ft=make:

_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
1
2
3
4
5
6
7
8
9
10
11
# vim:ft=make:

DAEMON_watchdogd_COMMAND?=watchdogd
DAEMON_watchdogd_ENABLE?=no
DAEMON_watchdogd_FLAGS?=-d

.if empty(${:!sysctl -qn debug.watchdog!})
DAEMON_watchdogd_ENABLE=no
.endif

watchdogd: _daemon


|



|




1
2
3
4
5
6
7
8
9
10
11
# vim:ft=make:

DAEMON_watchdogd_COMMAND?=/usr/sbin/watchdogd
DAEMON_watchdogd_ENABLE?=no
DAEMON_watchdogd_FLAGS?=-d

.if empty(${:!sysctl -qn debug.watchdog || exit 0!})
DAEMON_watchdogd_ENABLE=no
.endif

watchdogd: _daemon
1
2
3
4
5

6
7
8
9
10
11
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




|
>
|
|
|
|
|
|
<
1
2
3
4
5
6
7
8
9
10
11
12

# vim:ft=make:

wlans: kld
	: Configuring wlans.
	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