teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone
Blob Blame History Raw
From 3d2c847396cf348ef1ee55f5d4211045a6202efc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 30 Dec 2013 13:00:38 -0500
Subject: [PATCH] tmpfiles: rename --unsafe to --boot

As suggested by Kay, it is better to describe what is done,
not what might happen.
---
 man/systemd-tmpfiles.xml                |  2 +-
 man/tmpfiles.d.xml                      |  4 ++--
 src/tmpfiles/tmpfiles.c                 | 14 +++++++-------
 units/systemd-tmpfiles-setup.service.in |  2 +-
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/man/systemd-tmpfiles.xml b/man/systemd-tmpfiles.xml
index c678031..64f9cf9 100644
--- a/man/systemd-tmpfiles.xml
+++ b/man/systemd-tmpfiles.xml
@@ -133,7 +133,7 @@
                                 removed.</para></listitem>
                         </varlistentry>
                         <varlistentry>
-                                <term><option>--unsafe</option></term>
+                                <term><option>--boot</option></term>
                                 <listitem><para>Also execute lines
                                 with an exclamation mark.
                                 </para></listitem>
diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml
index ed88751..8267ffc 100644
--- a/man/tmpfiles.d.xml
+++ b/man/tmpfiles.d.xml
@@ -273,7 +273,7 @@ L    /tmp/foobar -    -    -    -   /dev/null</programlisting>
                         execute at any time, e.g. on package upgrades.
                         <command>systemd-tmpfiles</command> will
                         execute line with an exclamation mark only if
-                        option <option>--unsafe</option> is given.
+                        option <option>--boot</option> is given.
                         </para>
 
                         <para>For example:
@@ -286,7 +286,7 @@ r! /tmp/.X[0-9]*-lock
                         </programlisting>
                         The second line in contrast to the first one
                         would break a running system, and will only be
-                        executed with <option>--unsafe</option>.</para>
+                        executed with <option>--boot</option>.</para>
                 </refsect2>
 
                 <refsect2>
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 30a8a55..4dd1638 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -106,7 +106,7 @@ static Set *unix_sockets = NULL;
 static bool arg_create = false;
 static bool arg_clean = false;
 static bool arg_remove = false;
-static bool arg_unsafe = false;
+static bool arg_boot = false;
 
 static char **include_prefixes = NULL;
 static char **exclude_prefixes = NULL;
@@ -1100,7 +1100,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
         if (strlen(action) > 2 || (strlen(action) > 1 && action[1] != '!')) {
                 log_error("[%s:%u] Unknown modifier '%s'", fname, line, action);
                 return -EINVAL;
-        } else if (strlen(action) > 1 && !arg_unsafe)
+        } else if (strlen(action) > 1 && !arg_boot)
                 return 0;
 
         type = action[0];
@@ -1275,7 +1275,7 @@ static int help(void) {
                "     --create               Create marked files/directories\n"
                "     --clean                Clean up marked directories\n"
                "     --remove               Remove marked files/directories\n"
-               "     --unsafe               Execute actions only safe at boot\n"
+               "     --boot                 Execute actions only safe at boot\n"
                "     --prefix=PATH          Only apply rules that apply to paths with the specified prefix\n"
                "     --exclude-prefix=PATH  Ignore rules that apply to paths with the specified prefix\n",
                program_invocation_short_name);
@@ -1289,7 +1289,7 @@ static int parse_argv(int argc, char *argv[]) {
                 ARG_CREATE,
                 ARG_CLEAN,
                 ARG_REMOVE,
-                ARG_UNSAFE,
+                ARG_BOOT,
                 ARG_PREFIX,
                 ARG_EXCLUDE_PREFIX,
         };
@@ -1299,7 +1299,7 @@ static int parse_argv(int argc, char *argv[]) {
                 { "create",         no_argument,         NULL, ARG_CREATE         },
                 { "clean",          no_argument,         NULL, ARG_CLEAN          },
                 { "remove",         no_argument,         NULL, ARG_REMOVE         },
-                { "unsafe",         no_argument,         NULL, ARG_UNSAFE         },
+                { "boot",           no_argument,         NULL, ARG_BOOT           },
                 { "prefix",         required_argument,   NULL, ARG_PREFIX         },
                 { "exclude-prefix", required_argument,   NULL, ARG_EXCLUDE_PREFIX },
                 { NULL,             0,                   NULL, 0                  }
@@ -1330,8 +1330,8 @@ static int parse_argv(int argc, char *argv[]) {
                         arg_remove = true;
                         break;
 
-                case ARG_UNSAFE:
-                        arg_unsafe = true;
+                case ARG_BOOT:
+                        arg_boot = true;
                         break;
 
                 case ARG_PREFIX:
diff --git a/units/systemd-tmpfiles-setup.service.in b/units/systemd-tmpfiles-setup.service.in
index c2dcae0..01043b7 100644
--- a/units/systemd-tmpfiles-setup.service.in
+++ b/units/systemd-tmpfiles-setup.service.in
@@ -24,4 +24,4 @@ RefuseManualStop=yes
 [Service]
 Type=oneshot
 RemainAfterExit=yes
-ExecStart=@rootbindir@/systemd-tmpfiles --create --remove --unsafe --exclude-prefix=/dev
+ExecStart=@rootbindir@/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev