1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-27 10:25:06 +03:00

mount: add new SloppyOptions= setting for mount units, mapping to mount(8)'s "-s" switch

This commit is contained in:
Lennart Poettering 2014-06-16 01:02:27 +02:00
parent 8eb5a6e001
commit 2dbd4a9454
5 changed files with 21 additions and 2 deletions

View File

@ -250,6 +250,21 @@
setting is optional.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>SloppyOptions=</varname></term>
<listitem><para>Takes a boolean
argument. If true parsing of the
options specified in
<varname>Options=</varname> is
relaxed, and unknown mount options are
tolerated. This corresponds with
<citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s
<parameter>-s</parameter>
switch. Defaults to
off.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>DirectoryMode=</varname></term>
<listitem><para>Directories of mount

View File

@ -117,6 +117,7 @@ const sd_bus_vtable bus_mount_vtable[] = {
SD_BUS_PROPERTY("TimeoutUSec", "t", bus_property_get_usec, offsetof(Mount, timeout_usec), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("ControlPID", "u", bus_property_get_pid, offsetof(Mount, control_pid), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
SD_BUS_PROPERTY("DirectoryMode", "u", bus_property_get_mode, offsetof(Mount, directory_mode), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("SloppyOptions", "b", bus_property_get_bool, offsetof(Mount, sloppy_options), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("Result", "s", property_get_result, offsetof(Mount, result), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
BUS_EXEC_COMMAND_VTABLE("ExecMount", offsetof(Mount, exec_command[MOUNT_EXEC_MOUNT]), SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION),
BUS_EXEC_COMMAND_VTABLE("ExecUnmount", offsetof(Mount, exec_command[MOUNT_EXEC_UNMOUNT]), SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION),

View File

@ -274,6 +274,7 @@ Mount.Options, config_parse_string, 0,
Mount.Type, config_parse_string, 0, offsetof(Mount, parameters_fragment.fstype)
Mount.TimeoutSec, config_parse_sec, 0, offsetof(Mount, timeout_usec)
Mount.DirectoryMode, config_parse_mode, 0, offsetof(Mount, directory_mode)
Mount.SloppyOptions, config_parse_bool, 0, offsetof(Mount, sloppy_options)
EXEC_CONTEXT_CONFIG_ITEMS(Mount)m4_dnl
CGROUP_CONTEXT_CONFIG_ITEMS(Mount)m4_dnl
KILL_CONTEXT_CONFIG_ITEMS(Mount)m4_dnl

View File

@ -935,7 +935,7 @@ static void mount_enter_mounting(Mount *m) {
r = exec_command_set(
m->control_command,
"/bin/mount",
"-n",
m->sloppy_options ? "-ns" : "-n",
m->parameters_fragment.what,
m->where,
"-t", m->parameters_fragment.fstype ? m->parameters_fragment.fstype : "auto",
@ -983,7 +983,7 @@ static void mount_enter_remounting(Mount *m) {
r = exec_command_set(
m->control_command,
"/bin/mount",
"-n",
m->sloppy_options ? "-ns" : "-n",
m->parameters_fragment.what,
m->where,
"-t", m->parameters_fragment.fstype ? m->parameters_fragment.fstype : "auto",

View File

@ -88,6 +88,8 @@ struct Mount {
bool just_mounted:1;
bool just_changed:1;
bool sloppy_options;
MountResult result;
MountResult reload_result;