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