summaryrefslogtreecommitdiff
path: root/src/core/mount.c
diff options
context:
space:
mode:
authorBarron Rulon <barron@lexmark.com>2016-08-27 10:27:49 -0400
committerBarron Rulon <barron@lexmark.com>2016-08-27 10:46:52 -0400
commit4f8d40a9dc3d2dc754a30bc9455817ee6a857c62 (patch)
tree870fa22b1eb1989dc22b8ba40e07cd1bd62a48aa /src/core/mount.c
parente520950a03419957875034bc27795b0b81d8e793 (diff)
mount: add new ForceUnmount= setting for mount units, mapping to umount(8)'s "-f" switch
Diffstat (limited to 'src/core/mount.c')
-rw-r--r--src/core/mount.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/mount.c b/src/core/mount.c
index 2c2a54edbb..6c794d4073 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -678,7 +678,8 @@ static void mount_dump(Unit *u, FILE *f, const char *prefix) {
"%sFrom /proc/self/mountinfo: %s\n"
"%sFrom fragment: %s\n"
"%sDirectoryMode: %04o\n"
- "%sLazyUnmount: %s\n",
+ "%sLazyUnmount: %s\n"
+ "%sForceUnmount: %s\n",
prefix, mount_state_to_string(m->state),
prefix, mount_result_to_string(m->result),
prefix, m->where,
@@ -688,7 +689,8 @@ static void mount_dump(Unit *u, FILE *f, const char *prefix) {
prefix, yes_no(m->from_proc_self_mountinfo),
prefix, yes_no(m->from_fragment),
prefix, m->directory_mode,
- prefix, yes_no(m->lazy_unmount));
+ prefix, yes_no(m->lazy_unmount),
+ prefix, yes_no(m->force_unmount));
if (m->control_pid > 0)
fprintf(f,
@@ -850,6 +852,8 @@ static void mount_enter_unmounting(Mount *m) {
r = exec_command_set(m->control_command, UMOUNT_PATH, m->where, NULL);
if (r >= 0 && m->lazy_unmount)
r = exec_command_append(m->control_command, "-l", NULL);
+ if (r >= 0 && m->force_unmount)
+ r = exec_command_append(m->control_command, "-f", NULL);
if (r < 0)
goto fail;