diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-03-29 20:15:47 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-03-29 20:15:47 +0200 |
commit | 0a50a2194d1d798a831df7eb7f1ff40a40c25dea (patch) | |
tree | bc0e60cf5ad19491af08550b32696d7e578809e2 | |
parent | d22b26f95eb0b7008f38c909d93da9bc4f46622e (diff) | |
download | impressive-display-0a50a2194d1d798a831df7eb7f1ff40a40c25dea.tar.gz impressive-display-0a50a2194d1d798a831df7eb7f1ff40a40c25dea.tar.bz2 impressive-display-0a50a2194d1d798a831df7eb7f1ff40a40c25dea.zip |
Make cleanup trap more genuine: Really clean-up all created temporary files, make sure the impressive executable gets killed during clean-up.
-rw-r--r-- | debian/changelog | 7 | ||||
-rwxr-xr-x | impressive-display/bin/impressive-display | 23 |
2 files changed, 25 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog index 56f2a41..b1c5e57 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +impressive-display (0.2.1) UNRELEASED; urgency=medium + + * Make cleanup trap more genuine: Really clean-up all created temporary + files, make sure the impressive executable gets killed during clean-up. + + -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Tue, 29 Mar 2016 20:14:17 +0200 + impressive-display (0.2.0) unstable; urgency=medium * Initial release. diff --git a/impressive-display/bin/impressive-display b/impressive-display/bin/impressive-display index 22a584a..e1f654a 100755 --- a/impressive-display/bin/impressive-display +++ b/impressive-display/bin/impressive-display @@ -159,13 +159,26 @@ if [ -n "$HTTP_PROXY_URL" ]; then fi function cleanup { - if [ -e "$impressive_lock" ]; then - rm "$impessive_lock" - fi - if [ -e "$session_lock" ]; then - rm "$session_lock" + if [ -r "$impressive_lock" ]; then + impressive_pid=$(cat "$impressive_lock" | sed -e 's/[^0-9]*//g') + if [ -n "$impressive_pid" ]; then + kill -0 $impressive_pid 2>/dev/null && kill "$impressive_pid" + fi fi + + for rmfile in $impressive_lock \ + $session_lock \ + $pdffile_previous \ + $pdffile_downloaded \ + $pdffile_display \ + ; + do + if [ -e "$rmfile" ]; then + rm "$rmfile" + fi + done + } function pdf_is_portrait { |