Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
5ad76043
Commit
5ad76043
authored
Sep 10, 2020
by
Brad Davidson
Committed by
Brad Davidson
Sep 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace unmount read loop with awk
Signed-off-by:
Brad Davidson
<
brad.davidson@rancher.com
>
parent
041f18f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
24 deletions
+2
-24
install.sh
install.sh
+1
-12
install.sh
package/rpm/install.sh
+1
-12
No files found.
install.sh
View file @
5ad76043
...
...
@@ -546,18 +546,7 @@ getshims() {
killtree
$(
{
set
+x
;
}
2>/dev/null
;
getshims
;
set
-x
)
do_unmount() {
{ set +x; } 2>/dev/null
MOUNTS=
while read ignore mount ignore; do
MOUNTS="
$mount
\n
$MOUNTS
"
done </proc/self/mounts
MOUNTS=
$(
printf
$MOUNTS
|
grep
"^
$1
"
|
sort
-r
)
if [ -n "
${
MOUNTS
}
" ]; then
set -x
xargs -n 1 umount <<<
${
MOUNTS
}
else
set -x
fi
awk -v path="
$1
" '
$2
~ ("^" path) { print
$2
}' /proc/self/mounts | sort -r | xargs -r -t -n 1 umount
}
do_unmount '/run/k3s'
...
...
package/rpm/install.sh
View file @
5ad76043
...
...
@@ -546,18 +546,7 @@ getshims() {
killtree
$(
{
set
+x
;
}
2>/dev/null
;
getshims
;
set
-x
)
do_unmount() {
{ set +x; } 2>/dev/null
MOUNTS=
while read ignore mount ignore; do
MOUNTS="
$mount
\n
$MOUNTS
"
done </proc/self/mounts
MOUNTS=
$(
printf
$MOUNTS
|
grep
"^
$1
"
|
sort
-r
)
if [ -n "
${
MOUNTS
}
" ]; then
set -x
xargs -n 1 umount <<<
${
MOUNTS
}
else
set -x
fi
awk -v path="
$1
" '
$2
~ ("^" path) { print
$2
}' /proc/self/mounts | sort -r | xargs -r -t -n 1 umount
}
do_unmount '/run/k3s'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment