Skip to content

Commit

Permalink
Merge pull request #698 from yast/fix-umount-finish-log
Browse files Browse the repository at this point in the history
Fix unmounting logging
  • Loading branch information
imobachgs committed May 10, 2018
2 parents 809ce34 + d6a52ed commit 2403242
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 14 deletions.
7 changes: 7 additions & 0 deletions package/yast2-installation.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu May 10 13:10:41 UTC 2018 - igonzalezsosa@suse.com

- Log a warning when umounting a filesystem fails after
installation/upgrade (related to bsc#1090018).
- 4.0.59

-------------------------------------------------------------------
Tue May 08 12:04:00 CEST 2018 - aschnell@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-installation.spec
Expand Up @@ -16,7 +16,7 @@
#

Name: yast2-installation
Version: 4.0.58
Version: 4.0.59
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
30 changes: 17 additions & 13 deletions src/lib/installation/clients/umount_finish.rb
Expand Up @@ -159,14 +159,7 @@ def main
WFM.Execute(path(".local.umount"), umount_this)
)
if umount_result != true
# run "fuser" to get the details about open files
# (the details are printed on STDERR, redirect it)
fuser = begin
`LC_ALL=C fuser -v -m #{Shellwords.escape(umount_this)} 2>&1`
rescue => e
"fuser failed: #{e}"
end
log.warn("Running processes using #{umount_this}: #{fuser}")
log_running_processes(umount_this)
# bnc #395034
# Don't remount them read-only!
if Builtins.contains(
Expand Down Expand Up @@ -248,6 +241,7 @@ def main
# bnc #395034
# Don't remount them read-only!
next if @umount_status
log_running_processes(@tmp)

if Builtins.contains(
["/proc", "/sys", "/dev", "/proc/bus/usb"],
Expand Down Expand Up @@ -281,11 +275,7 @@ def main
WFM.Execute(path(".local.bash_output"), "mount")
)

@cmd = Builtins.sformat(
"fuser -v '%1' 2>&1",
String.Quote(Installation.destdir)
)
@cmd_run = Convert.to_map(WFM.Execute(path(".local.bash_output"), @cmd))
log_running_processes(Installation.destdir)

# storage-ng
=begin
Expand Down Expand Up @@ -441,5 +431,19 @@ def default_subvolume_as_ro(fs)
log.info("Setting root subvol read-only property on #{subvolume_path}")
Yast::Execute.on_target("btrfs", "property", "set", subvolume_path, "ro", "true")
end

# run "fuser" to get the details about open files
#
# @param mount_point [String]
def log_running_processes(mount_point)
fuser =
begin
# (the details are printed on STDERR, redirect it)
`LC_ALL=C fuser -v -m #{Shellwords.escape(mount_point)} 2>&1`
rescue => e
"fuser failed: #{e}"
end
log.warn("Running processes using #{mount_point}: #{fuser}")
end
end
end

0 comments on commit 2403242

Please sign in to comment.