tmpfiles.d init.d scripts
Now that the tmpfiles.d code is more tested, actually call it from init.d. It assumes that /run is already available when it runs. Please note it runs TWICE. - During sysinit, ideally just after /dev/shm is created, but before udev has started. After udev is also acceptable, but not ideal. - During boot, ideally just after localmount has completed. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
This commit is contained in:
parent
5c736ad63e
commit
4ff71bd741
@ -1,5 +1,5 @@
|
|||||||
DIR= ${CONFDIR}
|
DIR= ${CONFDIR}
|
||||||
CONF= bootmisc fsck hostname localmount urandom ${CONF-${OS}}
|
CONF= bootmisc fsck hostname localmount urandom tmpfilesd ${CONF-${OS}}
|
||||||
|
|
||||||
ifeq (${MKNET},)
|
ifeq (${MKNET},)
|
||||||
CONF+= network staticroute
|
CONF+= network staticroute
|
||||||
|
3
conf.d/tmpfilesd
Normal file
3
conf.d/tmpfilesd
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Extra options for tmpfiles.sh
|
||||||
|
#tmpfiles_opts="--verbose"
|
||||||
|
tmpfiles_opts=""
|
2
init.d/.gitignore
vendored
2
init.d/.gitignore
vendored
@ -41,3 +41,5 @@ syslogd
|
|||||||
termencoding
|
termencoding
|
||||||
ttys
|
ttys
|
||||||
wscons
|
wscons
|
||||||
|
tmpfilesd.boot
|
||||||
|
tmpfilesd.sysinit
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
DIR= ${INITDIR}
|
DIR= ${INITDIR}
|
||||||
SRCS= bootmisc.in fsck.in hostname.in local.in localmount.in netmount.in \
|
SRCS= bootmisc.in fsck.in hostname.in local.in localmount.in netmount.in \
|
||||||
root.in savecache.in swap.in swapfiles.in \
|
root.in savecache.in swap.in swapfiles.in \
|
||||||
|
tmpfilesd.boot.in tmpfilesd.sysinit.in \
|
||||||
swclock.in sysctl.in urandom.in ${SRCS-${OS}}
|
swclock.in sysctl.in urandom.in ${SRCS-${OS}}
|
||||||
BIN= ${OBJS}
|
BIN= ${OBJS}
|
||||||
|
|
||||||
|
18
init.d/tmpfilesd.boot.in
Normal file
18
init.d/tmpfilesd.boot.in
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!@PREFIX@/sbin/runscript
|
||||||
|
# Copyright 1999-2012 Gentoo Foundation
|
||||||
|
# Released under the 2-clause BSD license.
|
||||||
|
|
||||||
|
description="Create tmpfiles.d entries (boot)"
|
||||||
|
|
||||||
|
depend()
|
||||||
|
{
|
||||||
|
need localmount
|
||||||
|
}
|
||||||
|
|
||||||
|
start()
|
||||||
|
{
|
||||||
|
ebegin "${description/Create/Creating}"
|
||||||
|
@LIBEXECDIR@/sh/tmpfiles.sh --create ${tmpfiles_opts}
|
||||||
|
eend $?
|
||||||
|
return 0
|
||||||
|
}
|
20
init.d/tmpfilesd.sysinit.in
Normal file
20
init.d/tmpfilesd.sysinit.in
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#!@PREFIX@/sbin/runscript
|
||||||
|
# Copyright 1999-2012 Gentoo Foundation
|
||||||
|
# Released under the 2-clause BSD license.
|
||||||
|
|
||||||
|
description="Create tmpfiles.d entries (sysinit)"
|
||||||
|
|
||||||
|
depend()
|
||||||
|
{
|
||||||
|
# Convert to 'need dev' when the new udev is ready, for OpenRC 0.11
|
||||||
|
#need dev-mount
|
||||||
|
need dev
|
||||||
|
}
|
||||||
|
|
||||||
|
start()
|
||||||
|
{
|
||||||
|
ebegin "${description/Create/Creating}"
|
||||||
|
@LIBEXECDIR@/sh/tmpfiles.sh --create ${tmpfiles_opts}
|
||||||
|
eend $?
|
||||||
|
return 0
|
||||||
|
}
|
@ -38,9 +38,9 @@ BOOT-FreeBSD+= hostid newsyslog savecore syslogd
|
|||||||
# FreeBSD specific stuff
|
# FreeBSD specific stuff
|
||||||
BOOT-FreeBSD+= adjkerntz dumpon syscons
|
BOOT-FreeBSD+= adjkerntz dumpon syscons
|
||||||
|
|
||||||
BOOT-Linux+= hwclock keymaps modules mtab procfs termencoding
|
BOOT-Linux+= hwclock keymaps modules mtab procfs termencoding tmpfilesd.boot
|
||||||
SHUTDOWN-Linux= killprocs mount-ro
|
SHUTDOWN-Linux= killprocs mount-ro
|
||||||
SYSINIT-Linux= devfs dmesg sysfs
|
SYSINIT-Linux= devfs dmesg sysfs tmpfilesd.sysinit
|
||||||
|
|
||||||
# Generic BSD stuff
|
# Generic BSD stuff
|
||||||
BOOT-NetBSD+= hostid newsyslog savecore syslogd
|
BOOT-NetBSD+= hostid newsyslog savecore syslogd
|
||||||
|
@ -266,7 +266,7 @@ for FILE in $tmpfiles_d ; do
|
|||||||
# whine about invalid entries
|
# whine about invalid entries
|
||||||
case $1 in
|
case $1 in
|
||||||
f|F|w|d|D|p|L|c|b|x|r|R|z|Z) ;;
|
f|F|w|d|D|p|L|c|b|x|r|R|z|Z) ;;
|
||||||
\#) continue ;;
|
\#) continue ;;
|
||||||
*) warninvalid ; continue ;;
|
*) warninvalid ; continue ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user