From 4ff71bd7416b84712ec702c92d79c106b4f11eb1 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Wed, 26 Sep 2012 15:42:37 -0700 Subject: 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 --- init.d/.gitignore | 2 ++ init.d/Makefile | 1 + init.d/tmpfilesd.boot.in | 18 ++++++++++++++++++ init.d/tmpfilesd.sysinit.in | 20 ++++++++++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 init.d/tmpfilesd.boot.in create mode 100644 init.d/tmpfilesd.sysinit.in (limited to 'init.d') diff --git a/init.d/.gitignore b/init.d/.gitignore index f9df045a..515348bb 100644 --- a/init.d/.gitignore +++ b/init.d/.gitignore @@ -41,3 +41,5 @@ syslogd termencoding ttys wscons +tmpfilesd.boot +tmpfilesd.sysinit diff --git a/init.d/Makefile b/init.d/Makefile index d192749e..54e5fd55 100644 --- a/init.d/Makefile +++ b/init.d/Makefile @@ -1,6 +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}} BIN= ${OBJS} diff --git a/init.d/tmpfilesd.boot.in b/init.d/tmpfilesd.boot.in new file mode 100644 index 00000000..838bdd86 --- /dev/null +++ b/init.d/tmpfilesd.boot.in @@ -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 +} diff --git a/init.d/tmpfilesd.sysinit.in b/init.d/tmpfilesd.sysinit.in new file mode 100644 index 00000000..9a0dbe47 --- /dev/null +++ b/init.d/tmpfilesd.sysinit.in @@ -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 +} -- cgit v1.2.3