- From: Ash Berlin <
>
- To:
- Subject: [chef] Getting feedback from waking chef-client daemon
- Date: Sun, 30 Oct 2011 17:46:43 +0000
So I recently upgrade from chef 0.9 to 0.10 and remembered that you can now
send the client daemon on USR1 to wake it up and make it do a run.
Yippie.
Except that you get no output that it's doing anything: less wonderful.
So I made a short script that will send a signal then write the output from
the log and stop when the run completes:
https://gist.github.com/1325982
(Included in-band at end of email for everyone to lazy to click.)
Basically its like doing `tail -f $log_file`, but it automatically stops when
the chef run does.
-ash
__END__
#!/bin/bash
set -e
declare tail_pid
on_exit() {
rm -f $pipe
[ -n "$tail_pid" ] && kill $tail_pid
}
trap "on_exit" EXIT ERR
pipe=/tmp/pipe-$$
mkfifo $pipe
tail -fn0 /var/log/chef/client.log > $pipe &
tail_pid=$!
sudo kill -USR1 $(cat /var/run/chef/client.pid)
sed -r '/(ERROR: Sleeping for [[:digit:]+] seconds before trying again|INFO:
Report handlers complete)$/{q}' $pipe
- [chef] Getting feedback from waking chef-client daemon, Ash Berlin, 10/30/2011
Archive powered by MHonArc 2.6.16.