Skip to content

Commit

Permalink
docker-for-win: fix docker stop #106
Browse files Browse the repository at this point in the history
  • Loading branch information
mviereck committed Jan 22, 2019
1 parent dc2ab46 commit 6a08d2e
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions x11docker
Original file line number Diff line number Diff line change
Expand Up @@ -547,10 +547,6 @@ $(cat $Bgpidfile 2>/dev/null)"
verbose -d "Container still running. Executing 'docker stop'."
$Sudo $Dockerexe stop $Containername >>$Containerlogfile 2>&1 || verbose -d "docker stop failed"
}
[ "$Winsubsystem" ] && $Dockerexe ps -a | grep -q $Containername && {
verbose -d "Container still running. Executing 'docker stop'."
$Dockerexe stop $Containername >>$Containerlogfile 2>&1 || verbose -d "docker stop failed"
}
;;
*) # should never happen (tm)
note "Found remaining background process $Line
Expand Down Expand Up @@ -600,15 +596,15 @@ $(ps -p $Pid)"
}
}
# different stop behaviour on Windows because $Pid1pid is not in ps.
[ "$Winsubsystem" ] && [ "$Pid1pid" ] && [ "$Containername" ] && {
verbose -d "Stopping container $Containername"
$Sudo $Dockerexe stop $Containername >/dev/null 2>&1 || {
$Sudo $Dockerexe inspect $Containername >/dev/null 2>&1 && {
[ "$Winsubsystem" ] && [ "$Containername" ] && {
$Dockerexe ps -a | grep -q $Containername && {
verbose -d "Container still running. Executing 'docker stop'."
$Dockerexe stop $Containername >>$Containerlogfile 2>&1 || {
warning "Failed to stop container $Containername.
Will not clean cache to avoid file permission issues."
Preservecachefiles="yes"
}
}
}
}

# check for possible error
Expand Down

0 comments on commit 6a08d2e

Please sign in to comment.