diff --git a/lib/bash/daemon.sh b/lib/bash/daemon.sh index 91528b3d..1fe823b8 100644 --- a/lib/bash/daemon.sh +++ b/lib/bash/daemon.sh @@ -29,9 +29,6 @@ set -u # Arguments: # file - File to write PID to. # pid - PID to write into file. -# -# Required Global Variables: -# ON_EXIT - String to append "remove_pid_file file". make_pid_file() { local file=$1 local pid=$2 @@ -60,7 +57,6 @@ make_pid_file() { # PID file doesn't exist, or it does but its pid is stale. echo "$pid" > $file - ON_EXIT="$ON_EXIT; remove_pid_file $file" } remove_pid_file() { diff --git a/t/lib/bash/daemon.sh b/t/lib/bash/daemon.sh index b5946629..76ec4d0b 100644 --- a/t/lib/bash/daemon.sh +++ b/t/lib/bash/daemon.sh @@ -1,9 +1,8 @@ #!/usr/bin/env bash -TESTS=8 +TESTS=7 TMPDIR="$TEST_TMPDIR" -ON_EXIT=":" local file="$TMPDIR/pid-file" source "$LIB_DIR/log_warn_die.sh" @@ -31,15 +30,9 @@ cmd_ok \ "test ! -f $file" \ "PID file removed" -is \ - "$ON_EXIT" \ - ":; remove_pid_file $file" \ - "Sets ON_EXIT to remove PID file" - # ########################################################################### # PID file already exists and proc is running. # ########################################################################### -ON_EXIT="" echo $$ > $file (