[systemd-devel] [PATCH] tmpfiles.d: create /run/lock{, /lockdev} even without sysvcompat
Tom Gundersen
teg at jklm.no
Wed Jul 4 07:09:09 PDT 2012
Rather than skipping all of tmpfilse.d/legacy.conf when sysvcompat is
not enabled, just skip the line related to sysvinit.
This is useful when distro's (such as Arch) move away from systemd's
sysvcompat support, but still want to support legacy applications that
rely on /run/lock and /run/lock/lockdev. We probably have to support
these sorts of applications long after sysvinit is gone.
Reported-by: Tobias Powalowski <tpowa at archlinux.org>
---
Makefile.am | 8 +++++---
tmpfiles.d/.gitignore | 1 +
tmpfiles.d/legacy.conf | 22 ----------------------
tmpfiles.d/legacy.conf.m4 | 28 ++++++++++++++++++++++++++++
4 files changed, 34 insertions(+), 25 deletions(-)
create mode 100644 tmpfiles.d/.gitignore
delete mode 100644 tmpfiles.d/legacy.conf
create mode 100644 tmpfiles.d/legacy.conf.m4
diff --git a/Makefile.am b/Makefile.am
index 3b7ec0b..be93381 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -252,10 +252,8 @@ dist_tmpfiles_DATA = \
tmpfiles.d/tmp.conf \
tmpfiles.d/x11.conf
-if HAVE_SYSV_COMPAT
-dist_tmpfiles_DATA += \
+nodist_tmpfiles_DATA = \
tmpfiles.d/legacy.conf
-endif
dist_systemunit_DATA = \
units/graphical.target \
@@ -352,6 +350,7 @@ nodist_userunit_DATA = \
units/user/systemd-exit.service
EXTRA_DIST += \
+ tmpfiles/legacy.conf.m4 \
units/getty at .service.m4 \
units/serial-getty at .service.m4 \
units/console-shell.service.m4.in \
@@ -3188,6 +3187,9 @@ units/%: units/%.m4 Makefile
units/user/%: units/%.m4 Makefile
$(M4_PROCESS_USER)
+tmpfiles.d/%: tmpfiles.d/%.m4 Makefile
+ $(M4_PROCESS_SYSTEM)
+
nodist_polkitpolicy_DATA = \
$(polkitpolicy_in_files:.policy.in=.policy) \
$(polkitpolicy_in_in_files:.policy.in.in=.policy)
diff --git a/tmpfiles.d/.gitignore b/tmpfiles.d/.gitignore
new file mode 100644
index 0000000..3dfed28
--- /dev/null
+++ b/tmpfiles.d/.gitignore
@@ -0,0 +1 @@
+/legacy.conf
diff --git a/tmpfiles.d/legacy.conf b/tmpfiles.d/legacy.conf
deleted file mode 100644
index 92bd71b..0000000
--- a/tmpfiles.d/legacy.conf
+++ /dev/null
@@ -1,22 +0,0 @@
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-# See tmpfiles.d(5) for details
-
-# These files are considered legacy and are unnecessary on legacy-free
-# systems. /run/lock/subsys is used for serializing SysV service
-# execution, and hence without use on SysV-less systems.
-#
-# /run/lock/lockdev is used to serialize access to tty devices via
-# LCK..xxx style lock files, For more information see:
-# http://lists.freedesktop.org/archives/systemd-devel/2011-March/001823.html
-# On modern systems a BSD file lock is a better choice if
-# serialization is needed on those devices.
-
-d /run/lock 0755 root root -
-d /run/lock/subsys 0755 root root -
-d /run/lock/lockdev 0775 root lock -
diff --git a/tmpfiles.d/legacy.conf.m4 b/tmpfiles.d/legacy.conf.m4
new file mode 100644
index 0000000..f835609
--- /dev/null
+++ b/tmpfiles.d/legacy.conf.m4
@@ -0,0 +1,28 @@
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+
+# See tmpfiles.d(5) for details
+
+# These files are considered legacy and are unnecessary on legacy-free
+# systems.
+m4_ifdef(`HAVE_SYSV_COMPAT',
+#
+# /run/lock/subsys is used for serializing SysV service
+# execution, and hence without use on SysV-less systems.
+)m4_dnl
+#
+# /run/lock/lockdev is used to serialize access to tty devices via
+# LCK..xxx style lock files, For more information see:
+# http://lists.freedesktop.org/archives/systemd-devel/2011-March/001823.html
+# On modern systems a BSD file lock is a better choice if
+# serialization is needed on those devices.
+
+d /run/lock 0755 root root -
+m4_ifdef(`HAVE_SYSV_COMPAT',
+d /run/lock/subsys 0755 root root -
+)m4_dnl
+d /run/lock/lockdev 0775 root lock -
--
1.7.11.1
More information about the systemd-devel
mailing list