]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
manager: drop MountAuto= and SwapAuto= options
authorLennart Poettering <lennart@poettering.net>
Tue, 24 Apr 2012 11:53:31 +0000 (13:53 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 24 Apr 2012 11:53:34 +0000 (13:53 +0200)
The ability to set MountAuto=no and SwapAuto=no was useful during the
adoption phase of systemd, so that distributions could stick to their
classic mount scripts a bit longer. It is about time to get rid of it
now.

man/systemd.conf.xml
src/core/dbus-manager.c
src/core/main.c
src/core/manager.h
src/core/mount.c
src/core/swap.c
src/core/swap.h
src/core/system.conf

index d05a30bd48e41b254a3c74b9fb6b824dcc398d57..a110f245417fb8a648041b18368704427e91f06f 100644 (file)
                                 of CPU indexes.</para></listitem>
                         </varlistentry>
 
-                        <varlistentry>
-                                <term><varname>MountAuto=yes</varname></term>
-                                <term><varname>SwapAuto=yes</varname></term>
-
-                                <listitem><para>Configures whether
-                                systemd should automatically activate
-                                all swap or mounts listed in
-                                <filename>/etc/fstab</filename>, or
-                                whether this job is left to some other
-                                system script.</para></listitem>
-                        </varlistentry>
-
                         <varlistentry>
                                 <term><varname>DefaultControllers=cpu</varname></term>
 
index efc626ad873b3210fbf3e92ec0425ffee4274a69..770fce12099e7a7808801553a629892da26a2bd0 100644 (file)
         "  <property name=\"UnitPath\" type=\"as\" access=\"read\"/>\n" \
         "  <property name=\"NotifySocket\" type=\"s\" access=\"read\"/>\n" \
         "  <property name=\"ControlGroupHierarchy\" type=\"s\" access=\"read\"/>\n" \
-        "  <property name=\"MountAuto\" type=\"b\" access=\"read\"/>\n" \
-        "  <property name=\"SwapAuto\" type=\"b\" access=\"read\"/>\n"  \
         "  <property name=\"DefaultControllers\" type=\"as\" access=\"read\"/>\n" \
         "  <property name=\"DefaultStandardOutput\" type=\"s\" access=\"read\"/>\n" \
         "  <property name=\"DefaultStandardError\" type=\"s\" access=\"read\"/>\n" \
@@ -554,8 +552,6 @@ static const BusProperty bus_manager_properties[] = {
         { "UnitPath",      bus_property_append_strv,              "as", offsetof(Manager, lookup_paths.unit_path),     true },
         { "NotifySocket",  bus_property_append_string,             "s", offsetof(Manager, notify_socket),              true },
         { "ControlGroupHierarchy", bus_property_append_string,     "s", offsetof(Manager, cgroup_hierarchy),           true },
-        { "MountAuto",     bus_property_append_bool,               "b", offsetof(Manager, mount_auto)                  },
-        { "SwapAuto",      bus_property_append_bool,               "b", offsetof(Manager, swap_auto)                   },
         { "DefaultControllers", bus_property_append_strv,         "as", offsetof(Manager, default_controllers),        true },
         { "DefaultStandardOutput", bus_manager_append_exec_output, "s", offsetof(Manager, default_std_output)          },
         { "DefaultStandardError",  bus_manager_append_exec_output, "s", offsetof(Manager, default_std_error)           },
index 290de26022fc237c2e52a38e3a8ae6721054e9c9..e9fece8f7d105212babbb692dee0e0595c414e79 100644 (file)
@@ -76,8 +76,6 @@ static bool arg_show_status = true;
 #ifdef HAVE_SYSV_COMPAT
 static bool arg_sysv_console = true;
 #endif
-static bool arg_mount_auto = true;
-static bool arg_swap_auto = true;
 static char **arg_default_controllers = NULL;
 static char ***arg_join_controllers = NULL;
 static ExecOutput arg_default_std_output = EXEC_OUTPUT_JOURNAL;
@@ -658,8 +656,6 @@ static int parse_config_file(void) {
 #endif
                 { "Manager", "CrashChVT",             config_parse_int,          0, &arg_crash_chvt          },
                 { "Manager", "CPUAffinity",           config_parse_cpu_affinity2, 0, NULL                    },
-                { "Manager", "MountAuto",             config_parse_bool,         0, &arg_mount_auto          },
-                { "Manager", "SwapAuto",              config_parse_bool,         0, &arg_swap_auto           },
                 { "Manager", "DefaultControllers",    config_parse_strv,         0, &arg_default_controllers },
                 { "Manager", "DefaultStandardOutput", config_parse_output,       0, &arg_default_std_output  },
                 { "Manager", "DefaultStandardError",  config_parse_output,       0, &arg_default_std_error   },
@@ -1427,8 +1423,6 @@ int main(int argc, char *argv[]) {
 #ifdef HAVE_SYSV_COMPAT
         m->sysv_console = arg_sysv_console;
 #endif
-        m->mount_auto = arg_mount_auto;
-        m->swap_auto = arg_swap_auto;
         m->default_std_output = arg_default_std_output;
         m->default_std_error = arg_default_std_error;
         m->runtime_watchdog = arg_runtime_watchdog;
index 20b743ab35aae051d301c312b965f927f6e02d0a..808a0d4286c6b95f40fe1945df0164f0257b1623 100644 (file)
@@ -219,8 +219,6 @@ struct Manager {
 #ifdef HAVE_SYSV_COMPAT
         bool sysv_console;
 #endif
-        bool mount_auto;
-        bool swap_auto;
 
         ExecOutput default_std_output, default_std_error;
 
index dbd4893bcbdcafd05e89cf1dcf79f04a3504ed10..e662af0c87855516ac7a0f3b9f191b93ee847eea 100644 (file)
@@ -325,7 +325,7 @@ static int mount_add_fstab_links(Mount *m) {
         MountParameters *p;
         Unit *tu;
         int r;
-        bool noauto, nofail, handle, automount;
+        bool noauto, nofail, automount;
 
         assert(m);
 
@@ -343,11 +343,6 @@ static int mount_add_fstab_links(Mount *m) {
         automount =
                 mount_test_option(p->options, "comment=systemd.automount") ||
                 mount_test_option(p->options, "x-systemd-automount");
-        handle =
-                automount ||
-                mount_test_option(p->options, "comment=systemd.mount") ||
-                mount_test_option(p->options, "x-systemd-mount") ||
-                UNIT(m)->manager->mount_auto;
 
         if (mount_is_network(p)) {
                 target = SPECIAL_REMOTE_FS_TARGET;
@@ -391,7 +386,7 @@ static int mount_add_fstab_links(Mount *m) {
                 else /* automount + nofail */
                         return unit_add_two_dependencies(tu, UNIT_AFTER, UNIT_WANTS, am, true);
 
-        } else if (handle && !noauto) {
+        } else if (!noauto) {
 
                 /* Automatically add mount points that aren't natively
                  * configured to local-fs.target */
@@ -1574,7 +1569,6 @@ static int mount_load_etc_fstab(Manager *m) {
                                                  pri,
                                                  !!mount_test_option(me->mnt_opts, "noauto"),
                                                  !!mount_test_option(me->mnt_opts, "nofail"),
-                                                 !!mount_test_option(me->mnt_opts, "comment=systemd.swapon"),
                                                  false);
                 } else
                         k = mount_add_one(m, what, where, me->mnt_opts, me->mnt_type, me->mnt_passno, false, false);
index 363852d33657f60493e6717971e7ee0e2100b9ad..9c30c11bb468eebb336250d58005741e1e41bfac 100644 (file)
@@ -182,7 +182,6 @@ static int swap_add_target_links(Swap *s) {
 
         if (!p->noauto &&
             !p->nofail &&
-            (p->handle || UNIT(s)->manager->swap_auto) &&
             s->from_etc_fstab &&
             UNIT(s)->manager->running_as == MANAGER_SYSTEM)
                 if ((r = unit_add_dependency(tu, UNIT_WANTS, UNIT(s), true)) < 0)
@@ -322,7 +321,6 @@ int swap_add_one(
                 int priority,
                 bool noauto,
                 bool nofail,
-                bool handle,
                 bool set_flags) {
 
         Unit *u = NULL;
@@ -420,7 +418,6 @@ int swap_add_one(
         p->priority = priority;
         p->noauto = noauto;
         p->nofail = nofail;
-        p->handle = handle;
 
         unit_add_to_dbus_queue(u);
 
@@ -457,8 +454,9 @@ static int swap_process_new_swap(Manager *m, const char *device, int prio, bool
                 if (!(d = udev_device_new_from_devnum(m->udev, 'b', st.st_rdev)))
                         return -ENOMEM;
 
-                if ((dn = udev_device_get_devnode(d)))
-                        r = swap_add_one(m, dn, device, prio, false, false, false, set_flags);
+                dn = udev_device_get_devnode(d);
+                if (dn)
+                        r = swap_add_one(m, dn, device, prio, false, false, set_flags);
 
                 /* Add additional units for all symlinks */
                 first = udev_device_get_devlinks_list_entry(d);
@@ -475,14 +473,16 @@ static int swap_process_new_swap(Manager *m, const char *device, int prio, bool
                                 if ((!S_ISBLK(st.st_mode)) || st.st_rdev != udev_device_get_devnum(d))
                                         continue;
 
-                        if ((k = swap_add_one(m, p, device, prio, false, false, false, set_flags)) < 0)
+                        k = swap_add_one(m, p, device, prio, false, false, set_flags);
+                        if (k < 0)
                                 r = k;
                 }
 
                 udev_device_unref(d);
         }
 
-        if ((k = swap_add_one(m, device, device, prio, false, false, false, set_flags)) < 0)
+        k = swap_add_one(m, device, device, prio, false, false, set_flags);
+        if (k < 0)
                 r = k;
 
         return r;
@@ -576,7 +576,6 @@ static void swap_dump(Unit *u, FILE *f, const char *prefix) {
                 "%sPriority: %i\n"
                 "%sNoAuto: %s\n"
                 "%sNoFail: %s\n"
-                "%sHandle: %s\n"
                 "%sFrom /etc/fstab: %s\n"
                 "%sFrom /proc/swaps: %s\n"
                 "%sFrom fragment: %s\n",
@@ -586,7 +585,6 @@ static void swap_dump(Unit *u, FILE *f, const char *prefix) {
                 prefix, p->priority,
                 prefix, yes_no(p->noauto),
                 prefix, yes_no(p->nofail),
-                prefix, yes_no(p->handle),
                 prefix, yes_no(s->from_etc_fstab),
                 prefix, yes_no(s->from_proc_swaps),
                 prefix, yes_no(s->from_fragment));
index 5c0ef73026cb81b4b2f6d3968fd9f9c6fc63fdc0..2a6fceece2f3a76062047e8c6ad424c6a14bd8ae 100644 (file)
@@ -53,7 +53,6 @@ typedef struct SwapParameters {
         int priority;
         bool noauto:1;
         bool nofail:1;
-        bool handle:1;
 } SwapParameters;
 
 typedef enum SwapResult {
@@ -109,7 +108,7 @@ struct Swap {
 
 extern const UnitVTable swap_vtable;
 
-int swap_add_one(Manager *m, const char *what, const char *what_proc_swaps, int prio, bool no_auto, bool no_fail, bool handle, bool set_flags);
+int swap_add_one(Manager *m, const char *what, const char *what_proc_swaps, int prio, bool no_auto, bool no_fail, bool set_flags);
 
 int swap_add_one_mount_link(Swap *s, Mount *m);
 
index 779ae59963264c4b9830b265fedd036878d53cc8..2b14d3e31edd87afa579045edeac938cfcb5acfb 100644 (file)
@@ -18,8 +18,6 @@
 #SysVConsole=yes
 #CrashChVT=1
 #CPUAffinity=1 2
-#MountAuto=yes
-#SwapAuto=yes
 #DefaultControllers=cpu
 #DefaultStandardOutput=journal
 #DefaultStandardError=inherit