Tmpfiles: create and delete entries once in the boot runlevel.

Initially, we were creating tmpfiles entries in the sysinit runlevel and
again in the boot runlevel. Systemd runs the --create and --remove
options in one service called systemd-tmpfiles-setup after the local
file systems are mounted. Now we have a service called tmpfiles.setup
which emulates this.

This also closes the bug mentioned below, since we were originally
writing to files that were on read-only file systems and that were not
available.

Reported-by: <devurandom@gmx.net>
X-Gentoo-Bug: 439012
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=439012
This commit is contained in:
William Hubbs 2012-10-31 10:53:37 -05:00
parent eff07c48b7
commit 1a8cd5ff9d
7 changed files with 8 additions and 30 deletions

View File

@ -1,5 +1,5 @@
DIR= ${CONFDIR} DIR= ${CONFDIR}
CONF= bootmisc fsck hostname localmount netmount urandom tmpfilesd \ CONF= bootmisc fsck hostname localmount netmount urandom tmpfiles \
${CONF-${OS}} ${CONF-${OS}}
ifeq (${MKNET},) ifeq (${MKNET},)

3
init.d/.gitignore vendored
View File

@ -41,5 +41,4 @@ syslogd
termencoding termencoding
ttys ttys
wscons wscons
tmpfilesd.boot tmpfiles.setup
tmpfilesd.sysinit

View File

@ -1,8 +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 \ tmpfiles.setup.in swclock.in sysctl.in urandom.in ${SRCS-${OS}}
swclock.in sysctl.in urandom.in ${SRCS-${OS}}
BIN= ${OBJS} BIN= ${OBJS}
# Build our old net foo or not # Build our old net foo or not

View File

@ -2,7 +2,7 @@
# Copyright 1999-2012 Gentoo Foundation # Copyright 1999-2012 Gentoo Foundation
# Released under the 2-clause BSD license. # Released under the 2-clause BSD license.
description="Create tmpfiles.d entries (boot)" description="set up tmpfiles.d entries"
depend() depend()
{ {
@ -11,8 +11,8 @@ depend()
start() start()
{ {
ebegin "Creating ${description#Create }" ebegin "setting up tmpfiles.d entries"
@LIBEXECDIR@/sh/tmpfiles.sh --create ${tmpfiles_opts} @LIBEXECDIR@/sh/tmpfiles.sh --create --remove ${tmpfiles_opts}
eend $? eend $?
return 0 return 0
} }

View File

@ -1,20 +0,0 @@
#!@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
use dev
}
start()
{
ebegin "Creating ${description#Create }"
@LIBEXECDIR@/sh/tmpfiles.sh --create ${tmpfiles_opts}
eend $?
return 0
}

View File

@ -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 tmpfilesd.boot BOOT-Linux+= hwclock keymaps modules mtab procfs termencoding tmpfiles.setup
SHUTDOWN-Linux= killprocs mount-ro SHUTDOWN-Linux= killprocs mount-ro
SYSINIT-Linux= devfs dmesg sysfs tmpfilesd.sysinit SYSINIT-Linux= devfs dmesg sysfs
# Generic BSD stuff # Generic BSD stuff
BOOT-NetBSD+= hostid newsyslog savecore syslogd BOOT-NetBSD+= hostid newsyslog savecore syslogd