Check-in [ebafd89015]
Logged in as anonymous
Overview
Comment:adding starters, renaming stuff
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ebafd8901531470321774b8cb2fbc7cece165d8c1edaf843f55020ef940dfa38
User & Date: arcade on 2019-10-21 15:12:26.971
Other Links: manifest | tags
Context
2019-10-21
15:38
fix automountd, fix daemon, change daemonizers description check-in: be4f89a54b user: arcade tags: trunk
15:12
adding starters, renaming stuff check-in: ebafd89015 user: arcade tags: trunk
14:21
fix devd, fix order, change daemonizing process, adding nfsd check-in: 67838bd249 user: arcade tags: trunk
Changes
Modified Makefile from [0bc4666f63] to [aa2a86c99e].
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
.include "/etc/mrc.conf"
.export

OTHER_TARGETS:=_daemon _service
DAEMONIZER?=svc

.for daemonizer in ${:!find /etc/mrc -name '*.daemon.mk'!:S/\/etc\/mrc\///}
.include "${daemonizer}"
.endfor

.if !target(_daemon) || !target(_service)
.error No daemonizer defined.
.endif

#.MAKE.JOBS?=2
#.SILENT:

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



|
|

|
|


|
|







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

OTHER_TARGETS:=_service _earlyservice
STARTER?=svc

.for starter in ${:!find /etc/mrc -name '*.starter.mk'!:S/\/etc\/mrc\///}
.include "${starter}"
.endfor

.if !target(_service) || !target(_earlyservice)
.error No service handler defined.
.endif

#.MAKE.JOBS?=2
#.SILENT:

.if defined(AUTOBOOT)
SCRIPTS=${:!find /etc/mrc -name '*.init' -o -name '*.service'!:S/\/etc\/mrc\///}
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

.undef SCRIPTS

ENABLED=${:!env!:C/=.*//:M*_ENABLE}

.for var in ${ENABLED}
.if !empty(${var}:tl:Mno)
.info ${var}
.undef ${var}
.endif
.endfor

.undef ENABLED
.unexport-env
.export
.info ${:!env!}







|







|
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

.undef SCRIPTS

ENABLED=${:!env!:C/=.*//:M*_ENABLE}

.for var in ${ENABLED}
.if !empty(${var}:tl:Mno)
#.info ${var}
.undef ${var}
.endif
.endfor

.undef ENABLED
.unexport-env
.export
#.info ${:!env!}
1
2
3
4
5
6
7
8
9
# vim:ft=make:

DAEMON_automountd_COMMAND?=/usr/sbin/autmountd
DAEMON_automountd_ENABLE?=no
DAEMON_automountd_MODULES=autofs

automountd: _daemon # nfsclient -> DAEMON
.export DAEMON_$@_ENABLE
	test -z "$${DAEMON_$@_ENABLE}" || /usr/sbin/automount






|
<

1
2
3
4
5
6
7

8
# vim:ft=make:

DAEMON_automountd_COMMAND?=/usr/sbin/autmountd
DAEMON_automountd_ENABLE?=no
DAEMON_automountd_MODULES=autofs

automountd: _service # nfsclient -> DAEMON

	test -z "$${DAEMON_$@_ENABLE}" || /usr/sbin/automount
1
2
3
4
5
6
7
8
9
10
11
12
# vim:ft=make:

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

dbus: _daemon
.export DAEMON_$@_ENABLE
	test -z "$${DAEMON_$@_ENABLE}" || { \
	  /usr/local/bin/dbus-uuidgen --ensure; \
	  mkdir -p /var/run/dbus; \
	}






|





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

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

dbus: _service
.export DAEMON_$@_ENABLE
	test -z "$${DAEMON_$@_ENABLE}" || { \
	  /usr/local/bin/dbus-uuidgen --ensure; \
	  mkdir -p /var/run/dbus; \
	}
1
2
3
4
5
6
7
8
# vim:ft=make:

DAEMON_devd_COMMAND?=/sbin/devd
DAEMON_devd_ENABLE?=yes
DAEMON_devd_FLAGS?=-dq

devd: _service
	test -n "$${DAEMON_$@_ENABLE}" || sysctl hw.bus.devctl_disable=1






|

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

DAEMON_devd_COMMAND?=/sbin/devd
DAEMON_devd_ENABLE?=yes
DAEMON_devd_FLAGS?=-dq

devd: _earlyservice
	test -n "$${DAEMON_$@_ENABLE}" || sysctl hw.bus.devctl_disable=1
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
# vim:ft=make:

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

inetd: _service LOGIN
1
2
3
4
5
6
7
8
9
10
11
12
13
# 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
.export DAEMON_$@_ENABLE
	test -z "$${DAEMON_$@_ENABLE}" || \
	install -d -o ${DAEMON_node_exporter_USER} -g ${DAEMON_node_exporter_GROUP} -m1755 ${DAEMON_node_exporter_TEXTFILE_DIR}









|



1
2
3
4
5
6
7
8
9
10
11
12
13
# 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: _service
.export DAEMON_$@_ENABLE
	test -z "$${DAEMON_$@_ENABLE}" || \
	install -d -o ${DAEMON_node_exporter_USER} -g ${DAEMON_node_exporter_GROUP} -m1755 ${DAEMON_node_exporter_TEXTFILE_DIR}
1
2
3
4
5
6
7
# vim:ft=make:

DAEMON_rpcbind_COMMAND?=/usr/sbin/rpcbind
DAEMON_rpcbind_ENABLE?=no
DAEMON_rpcbind_FLAGS?=-d

rpcbind: _service NETWORK syslogd






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

DAEMON_rpcbind_COMMAND?=/usr/sbin/rpcbind
DAEMON_rpcbind_ENABLE?=no
DAEMON_rpcbind_FLAGS?=-d

rpcbind: _earlyservice NETWORK syslogd
1
2
3
4
5
6
7
# vim:ft=make:

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

slim: _daemon dbus
	rm -f /var/run/slim.auth





|

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

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

slim: _service dbus
	rm -f /var/run/slim.auth
1
2
3
4
5
6
7
8
9
10
11
12
13
# vim:ft=make:

DAEMON_smartd_COMMAND?=/usr/local/sbin/smartd
DAEMON_smartd_ENABLE?=no
DAEMON_smartd_FLAGS?=-c /usr/local/etc/smartd.conf -n

smartd: _daemon
.export DAEMON_$@_ENABLE
	test -z "$${DAEMON_$@_ENABLE}" || \
	test -f /usr/local/etc/smartd.conf || { \
	  echo smartd requires config file to start. ; \
	  false; \
	}






|






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

DAEMON_smartd_COMMAND?=/usr/local/sbin/smartd
DAEMON_smartd_ENABLE?=no
DAEMON_smartd_FLAGS?=-c /usr/local/etc/smartd.conf -n

smartd: _service
.export DAEMON_$@_ENABLE
	test -z "$${DAEMON_$@_ENABLE}" || \
	test -f /usr/local/etc/smartd.conf || { \
	  echo smartd requires config file to start. ; \
	  false; \
	}
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
# 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: _service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
LOCAL_TARGETS:=_daemon_svc _service_svc
OTHER_TARGETS+=${LOCAL_TARGETS}
.if ${DAEMONIZER} == "svc"
LOCAL_TARGETS:=${LOCAL_TARGETS} ${LOCAL_TARGETS:S/_svc//}
.endif

.for target in ${LOCAL_TARGETS}
${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}; \
	}
.endfor

#_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}; \
#	}

.undef LOCAL_TARGETS
|
|
|
|



|
<
<






<
<
<
<
<
<
<
<

1
2
3
4
5
6
7
8


9
10
11
12
13
14








15
LOCAL_TARGETS:=_service_svc _earlyservice_svc
OTHER_TARGETS+=_service_svc _earlyservice_svc
.if ${STARTER} == "svc"
LOCAL_TARGETS+=_service _earlyservice
.endif

.for target in ${LOCAL_TARGETS}
${target}: ${target:C/_service.*/DAEMON/:C/_earlyservice/SERVICE/} .USE


	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}; \
	}
.endfor









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

DAEMON_syslogd_COMMAND?=/usr/sbin/syslogd
DAEMON_syslogd_ENABLE?=yes
DAEMON_syslogd_FLAGS?=-ss8cc

syslogd: _service






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

DAEMON_syslogd_COMMAND?=/usr/sbin/syslogd
DAEMON_syslogd_ENABLE?=yes
DAEMON_syslogd_FLAGS?=-ss8cc

syslogd: _earlyservice
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
# 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: _earlyservice