manager: drop MountAuto= and SwapAuto= options

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.
This commit is contained in:
Lennart Poettering 2012-04-24 13:53:31 +02:00
parent 25f5971b5e
commit 8d8e945624
8 changed files with 10 additions and 45 deletions

View File

@ -103,18 +103,6 @@
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>

View File

@ -237,8 +237,6 @@
" <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) },

View 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;

View 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;

View 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);

View 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));

View 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);

View File

@ -18,8 +18,6 @@
#SysVConsole=yes
#CrashChVT=1
#CPUAffinity=1 2
#MountAuto=yes
#SwapAuto=yes
#DefaultControllers=cpu
#DefaultStandardOutput=journal
#DefaultStandardError=inherit