3 # testcase experimenting whether daemon --pidfile --fork --makepid works with RC_LOGGING=on and off
6 dir=$(readlink -f $(dirname "$0"))
7 testname=$(basename "$0")
8 # save flags, as want to load functions with set +x
12 . $dir/../lib/functions
15 pidfile=$dir/$testname.pid
16 makepid="$dir/../lib/makepid"
17 # use /bin/sleep to avoid using sleep builtin
18 testprog="/bin/sleep 300"
28 # command must match what was started
29 cmd=$(ps -o cmd= -p $pid)
30 test "$cmd" = "$testprog"
35 PIDFILE=$pidfile $makepid $testprog
41 daemon --pidfile $pidfile --fork --makepid $testprog