|
Zbigniew Jędrzejewski-Szmek |
126222 |
From 66b1ee20b814b02cd0fb73fec4a2a9b11defc607 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
Date: Fri, 20 Dec 2013 20:25:39 -0500
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
Subject: [PATCH] tmpfiles: introduce the concept of unsafe operations
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
Various operations done by systemd-tmpfiles may only be safely done at
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
boot (e.g. removal of X lockfiles in /tmp, creation of /run/nologin).
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
Other operations may be done at any point in time (e.g. setting the
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
ownership on /{run,var}/log/journal). This distinction is largely
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
orthogonal to the type of operation.
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
A new switch --unsafe is added, and operations which should only be
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
executed during bootup are marked with an exclamation mark in the
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
configuration files. systemd-tmpfiles.service is modified to use this
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
switch, and guards are added so it is hard to re-start it by mistake.
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
If we install a new version of systemd, we actually want to enforce
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
some changes to tmpfiles configuration immediately. This should now be
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
possible to do safely, so distribution packages can be modified to
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
execute the "safe" subset at package installation time.
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
/run/nologin creation is split out into a separate service, to make it
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
easy to override.
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
https://bugzilla.redhat.com/show_bug.cgi?id=1043212
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
https://bugzilla.redhat.com/show_bug.cgi?id=1045849
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
Makefile.am | 1 +
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
man/systemd-tmpfiles.xml | 6 ++++++
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
man/tmpfiles.d.xml | 25 +++++++++++++++++++++++++
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
src/tmpfiles/tmpfiles.c | 22 +++++++++++++++++++---
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
tmpfiles.d/legacy.conf | 6 +++---
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
tmpfiles.d/systemd-nologin.conf | 11 +++++++++++
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
tmpfiles.d/systemd.conf | 4 +---
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
tmpfiles.d/x11.conf | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
units/systemd-tmpfiles-setup.service.in | 6 ++++--
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
9 files changed, 71 insertions(+), 12 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
create mode 100644 tmpfiles.d/systemd-nologin.conf
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
diff --git a/Makefile.am b/Makefile.am
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
index 16a5c3c..6233a7f 100644
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
--- a/Makefile.am
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+++ b/Makefile.am
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -1599,6 +1599,7 @@ nodist_systemunit_DATA += \
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
dist_tmpfiles_DATA = \
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
tmpfiles.d/systemd.conf \
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ tmpfiles.d/systemd-nologin.conf \
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
tmpfiles.d/tmp.conf \
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
tmpfiles.d/x11.conf
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
diff --git a/man/systemd-tmpfiles.xml b/man/systemd-tmpfiles.xml
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
index 91c0372..495247e 100644
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
--- a/man/systemd-tmpfiles.xml
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+++ b/man/systemd-tmpfiles.xml
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -133,6 +133,12 @@
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
removed.</para></listitem>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
</varlistentry>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
<varlistentry>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ <term><option>--unsafe</option></term>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ <listitem><para>Also execute lines
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ with an exclamation mark.
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ </para></listitem>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ </varlistentry>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ <varlistentry>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
<term><option>--prefix=PATH</option></term>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
<listitem><para>Only apply rules that
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
apply to paths with the specified
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
index a00637b..39aa68d 100644
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
--- a/man/tmpfiles.d.xml
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+++ b/man/tmpfiles.d.xml
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -113,6 +113,9 @@ L /tmp/foobar - - - - /dev/null</programlisting>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
<refsect2>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
<title>Type</title>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ <para>The type consists of a single letter and
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ optionally an exclamation mark.</para>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
<para>The following line types are understood:</para>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
<variablelist>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -262,6 +265,28 @@ L /tmp/foobar - - - - /dev/null</programlisting>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
names.</para></listitem>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
</varlistentry>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
</variablelist>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ <para>If the exclamation mark is used, this
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ line is only safe of execute during boot, and
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ can break a running system. Lines without the
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ exclamation mark are presumed to be safe to
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ execute at any time, e.g. on package upgrades.
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ <command>systemd-tmpfiles</command> will
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ execute line with an exclamation mark only if
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ option <option>--unsafe</option> is given.
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ </para>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ <para>For example:
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ <programlisting>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+# Make sure these are created by default so that nobody else can
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+d /tmp/.X11-unix 1777 root root 10d
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+# Unlink the X11 lock files
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+r! /tmp/.X[0-9]*-lock
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ </programlisting>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ The second line in contrast to the first one
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ would break a running system, and will only be
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ executed with <option>--unsafe</option>.</para>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
</refsect2>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
<refsect2>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
index 00f74c2..30a8a55 100644
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
--- a/src/tmpfiles/tmpfiles.c
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+++ b/src/tmpfiles/tmpfiles.c
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -106,6 +106,7 @@ static Set *unix_sockets = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
static bool arg_create = false;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
static bool arg_clean = false;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
static bool arg_remove = false;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+static bool arg_unsafe = false;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
static char **include_prefixes = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
static char **exclude_prefixes = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -1073,7 +1074,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
_cleanup_item_free_ Item *i = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
Item *existing;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
_cleanup_free_ char
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
- *mode = NULL, *user = NULL, *group = NULL, *age = NULL, *path = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ *action = NULL, *mode = NULL, *user = NULL, *group = NULL, *age = NULL, *path = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
char type;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
Hashmap *h;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
int r, n = -1;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -1083,8 +1084,8 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
assert(buffer);
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
r = sscanf(buffer,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
- "%c %ms %ms %ms %ms %ms %n",
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
- &type,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ "%ms %ms %ms %ms %ms %ms %n",
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ &action,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
&path,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
&mode,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
&user,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -1096,6 +1097,14 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
return -EIO;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ if (strlen(action) > 2 || (strlen(action) > 1 && action[1] != '!')) {
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ log_error("[%s:%u] Unknown modifier '%s'", fname, line, action);
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ return -EINVAL;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ } else if (strlen(action) > 1 && !arg_unsafe)
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ return 0;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ type = action[0];
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
i = new0(Item, 1);
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
if (!i)
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
return log_oom();
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -1266,6 +1275,7 @@ static int help(void) {
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
" --create Create marked files/directories\n"
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
" --clean Clean up marked directories\n"
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
" --remove Remove marked files/directories\n"
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ " --unsafe Execute actions only safe at boot\n"
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
" --prefix=PATH Only apply rules that apply to paths with the specified prefix\n"
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
" --exclude-prefix=PATH Ignore rules that apply to paths with the specified prefix\n",
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
program_invocation_short_name);
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -1279,6 +1289,7 @@ static int parse_argv(int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
ARG_CREATE,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
ARG_CLEAN,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
ARG_REMOVE,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ ARG_UNSAFE,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
ARG_PREFIX,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
ARG_EXCLUDE_PREFIX,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
};
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -1288,6 +1299,7 @@ static int parse_argv(int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
{ "create", no_argument, NULL, ARG_CREATE },
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
{ "clean", no_argument, NULL, ARG_CLEAN },
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
{ "remove", no_argument, NULL, ARG_REMOVE },
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ { "unsafe", no_argument, NULL, ARG_UNSAFE },
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
{ "prefix", required_argument, NULL, ARG_PREFIX },
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
{ "exclude-prefix", required_argument, NULL, ARG_EXCLUDE_PREFIX },
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
{ NULL, 0, NULL, 0 }
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -1318,6 +1330,10 @@ static int parse_argv(int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
arg_remove = true;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
break;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ case ARG_UNSAFE:
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ arg_unsafe = true;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ break;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
case ARG_PREFIX:
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
if (strv_extend(&include_prefixes, optarg) < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
return log_oom();
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
diff --git a/tmpfiles.d/legacy.conf b/tmpfiles.d/legacy.conf
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
index 3fff347..a165687 100644
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
--- a/tmpfiles.d/legacy.conf
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+++ b/tmpfiles.d/legacy.conf
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -29,6 +29,6 @@ d /run/lock/lockdev 0775 root lock -
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
# kernel command line options 'fsck.mode=force', 'fsck.mode=skip' and
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
# 'quotacheck.mode=force'
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
-r /forcefsck
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
-r /fastboot
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
-r /forcequotacheck
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+r! /forcefsck
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+r! /fastboot
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+r! /forcequotacheck
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
diff --git a/tmpfiles.d/systemd-nologin.conf b/tmpfiles.d/systemd-nologin.conf
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
new file mode 100644
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
index 0000000..d61232b
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
--- /dev/null
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+++ b/tmpfiles.d/systemd-nologin.conf
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -0,0 +1,11 @@
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+# This file is part of systemd.
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+#
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+# systemd is free software; you can redistribute it and/or modify it
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+# under the terms of the GNU Lesser General Public License as published by
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+# the Free Software Foundation; either version 2.1 of the License, or
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+# (at your option) any later version.
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+# See tmpfiles.d(5) and systemd-forbid-user-logins.service(5).
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+# This file has special suffix so it is not run by mistake.
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+F! /run/nologin 0644 - - - "System is booting up. See pam_nologin(8)"
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
diff --git a/tmpfiles.d/systemd.conf b/tmpfiles.d/systemd.conf
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
index a05c657..7c6d6b9 100644
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
--- a/tmpfiles.d/systemd.conf
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+++ b/tmpfiles.d/systemd.conf
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -8,7 +8,7 @@
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
# See tmpfiles.d(5) for details
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
d /run/user 0755 root root ~10d
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
-F /run/utmp 0664 root utmp -
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+F! /run/utmp 0664 root utmp -
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
f /var/log/wtmp 0664 root utmp -
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
f /var/log/btmp 0600 root utmp -
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -22,8 +22,6 @@ d /run/systemd/users 0755 root root -
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
d /run/systemd/machines 0755 root root -
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
d /run/systemd/shutdown 0755 root root -
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
-F /run/nologin 0644 - - - "System is booting up. See pam_nologin(8)"
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
m /var/log/journal 2755 root systemd-journal - -
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
m /var/log/journal/%m 2755 root systemd-journal - -
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
m /run/log/journal 2755 root systemd-journal - -
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
diff --git a/tmpfiles.d/x11.conf b/tmpfiles.d/x11.conf
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
index ece6a5c..4c96a54 100644
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
--- a/tmpfiles.d/x11.conf
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+++ b/tmpfiles.d/x11.conf
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -15,4 +15,4 @@ d /tmp/.font-unix 1777 root root 10d
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
d /tmp/.Test-unix 1777 root root 10d
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
# Unlink the X11 lock files
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
-r /tmp/.X[0-9]*-lock
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+r! /tmp/.X[0-9]*-lock
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
diff --git a/units/systemd-tmpfiles-setup.service.in b/units/systemd-tmpfiles-setup.service.in
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
index 3405e28..c2dcae0 100644
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
--- a/units/systemd-tmpfiles-setup.service.in
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+++ b/units/systemd-tmpfiles-setup.service.in
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -6,7 +6,7 @@
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
# (at your option) any later version.
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
[Unit]
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
-Description=Recreate Volatile Files and Directories
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+Description=Create Volatile Files and Directories
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
Documentation=man:tmpfiles.d(5) man:systemd-tmpfiles(8)
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
DefaultDependencies=no
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
Wants=local-fs.target
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -18,8 +18,10 @@ ConditionDirectoryNotEmpty=|/lib/tmpfiles.d
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
ConditionDirectoryNotEmpty=|/usr/local/lib/tmpfiles.d
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
ConditionDirectoryNotEmpty=|/etc/tmpfiles.d
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
ConditionDirectoryNotEmpty=|/run/tmpfiles.d
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+RefuseManualStart=yes
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+RefuseManualStop=yes
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
[Service]
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
Type=oneshot
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
RemainAfterExit=yes
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
-ExecStart=@rootbindir@/systemd-tmpfiles --create --remove --exclude-prefix=/dev
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ExecStart=@rootbindir@/systemd-tmpfiles --create --remove --unsafe --exclude-prefix=/dev
|