daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
572a44
From 81e897b916baa556c7f0ef7bceedb5b73d550bad Mon Sep 17 00:00:00 2001
572a44
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
572a44
Date: Mon, 30 Dec 2013 13:00:38 -0500
572a44
Subject: [PATCH] tmpfiles: rename --unsafe to --boot
572a44
572a44
As suggested by Kay, it is better to describe what is done,
572a44
not what might happen.
572a44
---
572a44
 man/systemd-tmpfiles.xml                |  2 +-
572a44
 man/tmpfiles.d.xml                      |  4 ++--
572a44
 src/tmpfiles/tmpfiles.c                 | 14 +++++++-------
572a44
 units/systemd-tmpfiles-setup.service.in |  2 +-
572a44
 4 files changed, 11 insertions(+), 11 deletions(-)
572a44
572a44
diff --git a/man/systemd-tmpfiles.xml b/man/systemd-tmpfiles.xml
572a44
index c678031..64f9cf9 100644
572a44
--- a/man/systemd-tmpfiles.xml
572a44
+++ b/man/systemd-tmpfiles.xml
572a44
@@ -133,7 +133,7 @@
572a44
                                 removed.</para></listitem>
572a44
                         </varlistentry>
572a44
                         <varlistentry>
572a44
-                                <term><option>--unsafe</option></term>
572a44
+                                <term><option>--boot</option></term>
572a44
                                 <listitem><para>Also execute lines
572a44
                                 with an exclamation mark.
572a44
                                 </para></listitem>
572a44
diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml
572a44
index ed88751..8267ffc 100644
572a44
--- a/man/tmpfiles.d.xml
572a44
+++ b/man/tmpfiles.d.xml
572a44
@@ -273,7 +273,7 @@ L    /tmp/foobar -    -    -    -   /dev/null</programlisting>
572a44
                         execute at any time, e.g. on package upgrades.
572a44
                         <command>systemd-tmpfiles</command> will
572a44
                         execute line with an exclamation mark only if
572a44
-                        option <option>--unsafe</option> is given.
572a44
+                        option <option>--boot</option> is given.
572a44
                         </para>
572a44
 
572a44
                         <para>For example:
572a44
@@ -286,7 +286,7 @@ r! /tmp/.X[0-9]*-lock
572a44
                         </programlisting>
572a44
                         The second line in contrast to the first one
572a44
                         would break a running system, and will only be
572a44
-                        executed with <option>--unsafe</option>.</para>
572a44
+                        executed with <option>--boot</option>.</para>
572a44
                 </refsect2>
572a44
 
572a44
                 <refsect2>
572a44
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
572a44
index 1983717..67b13bc 100644
572a44
--- a/src/tmpfiles/tmpfiles.c
572a44
+++ b/src/tmpfiles/tmpfiles.c
572a44
@@ -106,7 +106,7 @@ static Set *unix_sockets = NULL;
572a44
 static bool arg_create = false;
572a44
 static bool arg_clean = false;
572a44
 static bool arg_remove = false;
572a44
-static bool arg_unsafe = false;
572a44
+static bool arg_boot = false;
572a44
 
572a44
 static char **include_prefixes = NULL;
572a44
 static char **exclude_prefixes = NULL;
572a44
@@ -1100,7 +1100,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
572a44
         if (strlen(action) > 2 || (strlen(action) > 1 && action[1] != '!')) {
572a44
                 log_error("[%s:%u] Unknown modifier '%s'", fname, line, action);
572a44
                 return -EINVAL;
572a44
-        } else if (strlen(action) > 1 && !arg_unsafe)
572a44
+        } else if (strlen(action) > 1 && !arg_boot)
572a44
                 return 0;
572a44
 
572a44
         type = action[0];
572a44
@@ -1275,7 +1275,7 @@ static int help(void) {
572a44
                "     --create               Create marked files/directories\n"
572a44
                "     --clean                Clean up marked directories\n"
572a44
                "     --remove               Remove marked files/directories\n"
572a44
-               "     --unsafe               Execute actions only safe at boot\n"
572a44
+               "     --boot                 Execute actions only safe at boot\n"
572a44
                "     --prefix=PATH          Only apply rules that apply to paths with the specified prefix\n"
572a44
                "     --exclude-prefix=PATH  Ignore rules that apply to paths with the specified prefix\n",
572a44
                program_invocation_short_name);
572a44
@@ -1289,7 +1289,7 @@ static int parse_argv(int argc, char *argv[]) {
572a44
                 ARG_CREATE,
572a44
                 ARG_CLEAN,
572a44
                 ARG_REMOVE,
572a44
-                ARG_UNSAFE,
572a44
+                ARG_BOOT,
572a44
                 ARG_PREFIX,
572a44
                 ARG_EXCLUDE_PREFIX,
572a44
         };
572a44
@@ -1299,7 +1299,7 @@ static int parse_argv(int argc, char *argv[]) {
572a44
                 { "create",         no_argument,         NULL, ARG_CREATE         },
572a44
                 { "clean",          no_argument,         NULL, ARG_CLEAN          },
572a44
                 { "remove",         no_argument,         NULL, ARG_REMOVE         },
572a44
-                { "unsafe",         no_argument,         NULL, ARG_UNSAFE         },
572a44
+                { "boot",           no_argument,         NULL, ARG_BOOT           },
572a44
                 { "prefix",         required_argument,   NULL, ARG_PREFIX         },
572a44
                 { "exclude-prefix", required_argument,   NULL, ARG_EXCLUDE_PREFIX },
572a44
                 { NULL,             0,                   NULL, 0                  }
572a44
@@ -1330,8 +1330,8 @@ static int parse_argv(int argc, char *argv[]) {
572a44
                         arg_remove = true;
572a44
                         break;
572a44
 
572a44
-                case ARG_UNSAFE:
572a44
-                        arg_unsafe = true;
572a44
+                case ARG_BOOT:
572a44
+                        arg_boot = true;
572a44
                         break;
572a44
 
572a44
                 case ARG_PREFIX:
572a44
diff --git a/units/systemd-tmpfiles-setup.service.in b/units/systemd-tmpfiles-setup.service.in
572a44
index c2dcae0..01043b7 100644
572a44
--- a/units/systemd-tmpfiles-setup.service.in
572a44
+++ b/units/systemd-tmpfiles-setup.service.in
572a44
@@ -24,4 +24,4 @@ RefuseManualStop=yes
572a44
 [Service]
572a44
 Type=oneshot
572a44
 RemainAfterExit=yes
572a44
-ExecStart=@rootbindir@/systemd-tmpfiles --create --remove --unsafe --exclude-prefix=/dev
572a44
+ExecStart=@rootbindir@/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev