diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2012-10-31 10:53:37 -0500 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2012-10-31 17:33:14 -0500 |
commit | 1a8cd5ff9ded16dd071624fa056712678b2cda6a (patch) | |
tree | 091a881aa2b99fa59a39299a8cd1668b1aef2640 | |
parent | eff07c48b7a2266a4c82a202960856b4f39936d0 (diff) |
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
-rw-r--r-- | conf.d/Makefile | 2 | ||||
-rw-r--r-- | conf.d/tmpfiles (renamed from conf.d/tmpfilesd) | 0 | ||||
-rw-r--r-- | init.d/.gitignore | 3 | ||||
-rw-r--r-- | init.d/Makefile | 3 | ||||
-rw-r--r-- | init.d/tmpfiles.setup.in (renamed from init.d/tmpfilesd.boot.in) | 6 | ||||
-rw-r--r-- | init.d/tmpfilesd.sysinit.in | 20 | ||||
-rw-r--r-- | runlevels/Makefile | 4 |
7 files changed, 8 insertions, 30 deletions
diff --git a/conf.d/Makefile b/conf.d/Makefile index 1f289672..24db5891 100644 --- a/conf.d/Makefile +++ b/conf.d/Makefile @@ -1,5 +1,5 @@ DIR= ${CONFDIR} -CONF= bootmisc fsck hostname localmount netmount urandom tmpfilesd \ +CONF= bootmisc fsck hostname localmount netmount urandom tmpfiles \ ${CONF-${OS}} ifeq (${MKNET},) diff --git a/conf.d/tmpfilesd b/conf.d/tmpfiles index c3f208fe..c3f208fe 100644 --- a/conf.d/tmpfilesd +++ b/conf.d/tmpfiles diff --git a/init.d/.gitignore b/init.d/.gitignore index 515348bb..c42cd770 100644 --- a/init.d/.gitignore +++ b/init.d/.gitignore @@ -41,5 +41,4 @@ syslogd termencoding ttys wscons -tmpfilesd.boot -tmpfilesd.sysinit +tmpfiles.setup diff --git a/init.d/Makefile b/init.d/Makefile index 54e5fd55..04e09a70 100644 --- a/init.d/Makefile +++ b/init.d/Makefile @@ -1,8 +1,7 @@ DIR= ${INITDIR} SRCS= bootmisc.in fsck.in hostname.in local.in localmount.in netmount.in \ root.in savecache.in swap.in swapfiles.in \ - tmpfilesd.boot.in tmpfilesd.sysinit.in \ - swclock.in sysctl.in urandom.in ${SRCS-${OS}} + tmpfiles.setup.in swclock.in sysctl.in urandom.in ${SRCS-${OS}} BIN= ${OBJS} # Build our old net foo or not diff --git a/init.d/tmpfilesd.boot.in b/init.d/tmpfiles.setup.in index 471c1280..a3ecd314 100644 --- a/init.d/tmpfilesd.boot.in +++ b/init.d/tmpfiles.setup.in @@ -2,7 +2,7 @@ # Copyright 1999-2012 Gentoo Foundation # Released under the 2-clause BSD license. -description="Create tmpfiles.d entries (boot)" +description="set up tmpfiles.d entries" depend() { @@ -11,8 +11,8 @@ depend() start() { - ebegin "Creating ${description#Create }" - @LIBEXECDIR@/sh/tmpfiles.sh --create ${tmpfiles_opts} + ebegin "setting up tmpfiles.d entries" + @LIBEXECDIR@/sh/tmpfiles.sh --create --remove ${tmpfiles_opts} eend $? return 0 } diff --git a/init.d/tmpfilesd.sysinit.in b/init.d/tmpfilesd.sysinit.in deleted file mode 100644 index 303a1cf2..00000000 --- a/init.d/tmpfilesd.sysinit.in +++ /dev/null @@ -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 -} diff --git a/runlevels/Makefile b/runlevels/Makefile index a4fd006f..e459d15f 100644 --- a/runlevels/Makefile +++ b/runlevels/Makefile @@ -38,9 +38,9 @@ BOOT-FreeBSD+= hostid newsyslog savecore syslogd # FreeBSD specific stuff 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 -SYSINIT-Linux= devfs dmesg sysfs tmpfilesd.sysinit +SYSINIT-Linux= devfs dmesg sysfs # Generic BSD stuff BOOT-NetBSD+= hostid newsyslog savecore syslogd |