Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
tails
tails
Commits
b584b60c
Commit
b584b60c
authored
Oct 21, 2014
by
Tails developers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use helper function.
parent
54c4ac55
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
15 deletions
+12
-15
config/chroot_local-includes/usr/local/lib/tails-shell-library/chroot-browser.sh
...ludes/usr/local/lib/tails-shell-library/chroot-browser.sh
+6
-15
config/chroot_local-includes/usr/local/lib/tails-shell-library/common.sh
...ocal-includes/usr/local/lib/tails-shell-library/common.sh
+6
-0
No files found.
config/chroot_local-includes/usr/local/lib/tails-shell-library/chroot-browser.sh
View file @
b584b60c
...
...
@@ -7,27 +7,18 @@
# Import windows_camouflage_is_enabled()
.
/usr/local/lib/tails-shell-library/tails-greeter.sh
# Import try_for().
.
/usr/local/lib/tails-shell-library/common.sh
# Break down the chroot and kill all of its processes
try_cleanup_browser_chroot
()
{
local chroot
=
"
${
1
}
"
local
cow
=
"
${
2
}
"
local
user
=
"
${
3
}
"
local
counter
=
0
local
ret
=
0
while
[
"
${
counter
}
"
-le
10
]
&&
pgrep
-u
${
user
}
1>/dev/null 2>&1
;
do
pkill
-u
${
user
}
1>/dev/null 2>&1
ret
=
${
?
}
sleep
1
counter
=
$((${
counter
}
+
1
))
done
[
${
ret
}
-eq
0
]
||
pkill
-9
-u
${
user
}
1>/dev/null 2>&1
try_for 10
"pkill -u
${
user
}
1>/dev/null 2>&1"
||
\
pkill
-9
-u
${
user
}
1>/dev/null 2>&1
for
mnt
in
${
chroot
}
/dev
${
chroot
}
/proc
${
chroot
}
${
cow
}
;
do
counter
=
0
while
[
"
${
counter
}
"
-le
10
]
&&
mountpoint
-q
${
mnt
}
2>/dev/null
;
do
umount
${
mnt
}
2>/dev/null
sleep
1
counter
=
$((${
counter
}
+
1
))
done
try_for 10
"umount
${
mnt
}
2>/dev/null"
done
rmdir
${
cow
}
${
chroot
}
2>/dev/null
}
...
...
config/chroot_local-includes/usr/local/lib/tails-shell-library/common.sh
View file @
b584b60c
...
...
@@ -14,3 +14,9 @@ wait_until() {
done
return
0
}
# Just an alias. The second argument (wait_until()'s check_expr) is
# the "try code block".
try_for
()
{
wait_until
"
${
@
}
"
}
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