Lines Matching full:daemon

30 	atf_set "descr" "daemon should write pid files for itself and its child"
33 daemon -P daemon.pid -p sleep.pid sleep 300
34 atf_check -s exit:0 test -f daemon.pid
35 atf_check -s exit:0 -o match:"daemon: sleep" ps -p `cat daemon.pid`
40 if [ -f daemon.pid ]; then
41 daemon_pid=`cat daemon.pid`
47 # NB: killing the sleep should kill the daemon too, so we musn't fail
54 atf_set "descr" "daemon should chdir to /"
58 daemon -p ${PWD}/sleep.pid -c bin/sleep 300
69 atf_set "descr" "daemon should write its child's pid to a pidfile"
72 daemon -p sleep.pid sleep 300
82 atf_set "descr" "daemon should refuse to clobber an existing child"
85 daemon -p sleep.pid sleep 300
88 daemon -p sleep.pid sleep 300
96 atf_set "descr" "daemon should close and reopen the output file on SIGHUP"
107 daemon -P daemon.pid -H -o output_file ./child.sh
108 atf_check -s exit:0 test -f daemon.pid
111 kill -HUP `cat daemon.pid`
117 [ -f daemon.pid ] && kill `cat daemon.pid`
122 atf_set "descr" "daemon should redirect stdout to a file"
125 daemon -o output_file seq 1 5
132 atf_set "descr" "daemon should restart a dead child"
135 daemon -rP daemon.pid -p sleep.pid sleep 300
136 atf_check -s exit:0 test -f daemon.pid
140 # Wait up to 10s for the daemon to restart the child.
154 [ -f daemon.pid ] && kill `cat daemon.pid`
159 atf_set "descr" "daemon should terminate with SIGTERM even pending child restart"
162 daemon -rP daemon.pid -R 10 -p sleep.pid sleep 300
163 atf_check -s exit:0 test -f daemon.pid
177 read daemon_pid < daemon.pid
180 # Wait up to 10s for the daemon to terminate
182 [ ! -f "daemon.pid" ] && break
186 atf_check test ! -f "daemon.pid"
190 [ -s daemon.pid ] && kill -9 `cat daemon.pid`
196 atf_set "descr" "daemon should write its own pid to a pidfile"
199 daemon -P daemon.pid sleep 300
200 atf_check -s exit:0 test -f daemon.pid
201 atf_check -s exit:0 -o match:"daemon: sleep" ps -p `cat daemon.pid`
204 [ -f daemon.pid ] && kill `cat daemon.pid`
209 atf_set "descr" "daemon should refuse to clobber an existing instance"
212 daemon -P daemon.pid sleep 300
213 atf_check -s exit:0 test -f daemon.pid
215 daemon -p daemon.pid sleep 300
218 [ -f daemon.pid ] && kill `cat daemon.pid`
223 atf_set "descr" "daemon should change its process title"
226 daemon -P daemon.pid -t "I'm a title!" sleep 300
227 atf_check -s exit:0 test -f daemon.pid
228 atf_check -s exit:0 -o match:"daemon: I'm a title!" \
229 ps -p `cat daemon.pid`
232 [ -f daemon.pid ] && kill `cat daemon.pid`
237 atf_set "descr" "daemon should drop privileges"
241 daemon -p sleep.pid -u nobody sleep 300