After displaying the ok_message, the installer will wait forever. CTRL-C to proceed, and CTRL-C again to cancel the BWC installation.
After cancelling the installation, you can reproduce the issue by executing the following script any number of times:
#!/bin/bash
adddate() {
while IFS= read -r line; do
echo "$(date +%Y%m%dT%H%M%S%z) $line"
done
}
configure_st2chatops() {
echo "Start"
sudo service st2chatops restart
echo "Finish"
}
configure_st2chatops | adddate | sudo tee a
exit ${PIPESTATUS[0]}
You'll notice that configure_st2chatops finishes, but the pipe never closes. You can remove adddate from the pipe, but that makes no difference. If you replace configure_st2chatops | adddate | sudo tee a with configure_st2chatops, then the script finishes as expected (but then there's no logging with timestamps).
On the other hand, if you leave the pipe as specified above, but comment out sudo service st2chatops restart, the pipe closes successfully.
I was unable to replace nohup_start with daemon in a way that successfully started st2chatops (i.e., hubot). Hopefully I've provided enough information here so someone else can easily fix. If not, I'll try to figure it out.
I should add that while appending > /dev/null to sudo service st2chatops restart makes the above script work, it will not work in the actual st2bootstrap-el6.sh script.
NOTE: This issue only applies to
el6
systems.Define the
HUBOT_SLACK_TOKEN
variable, and then install BWC using:After displaying the
ok_message
, the installer will wait forever.CTRL-C
to proceed, andCTRL-C
again to cancel the BWC installation.After cancelling the installation, you can reproduce the issue by executing the following script any number of times:
You'll notice that
configure_st2chatops
finishes, but the pipe never closes. You can removeadddate
from the pipe, but that makes no difference. If you replaceconfigure_st2chatops | adddate | sudo tee a
withconfigure_st2chatops
, then the script finishes as expected (but then there's no logging with timestamps).On the other hand, if you leave the pipe as specified above, but comment out
sudo service st2chatops restart
, the pipe closes successfully.We can conclude there's something in
sudo service st2chatops restart
that doesn't interact well with pipes. The other services on el6 use thedaemon
function as opposed tonohup_start
. Compare https://github.com/StackStorm/st2chatops/blob/master/rpm/st2chatops.init with https://github.com/StackStorm/st2-packages/blob/master/packages/st2/rpm/st2api.initI was unable to replace
nohup_start
withdaemon
in a way that successfully startedst2chatops
(i.e.,hubot
). Hopefully I've provided enough information here so someone else can easily fix. If not, I'll try to figure it out.