Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installer waits forever on el6 if HUBOT_SLACK_TOKEN is defined #96

Open
warrenvw opened this issue Nov 3, 2017 · 1 comment
Open

Installer waits forever on el6 if HUBOT_SLACK_TOKEN is defined #96

warrenvw opened this issue Nov 3, 2017 · 1 comment

Comments

@warrenvw
Copy link

warrenvw commented Nov 3, 2017

NOTE: This issue only applies to el6 systems.

Define the HUBOT_SLACK_TOKEN variable, and then install BWC using:

curl -sSL -O https://brocade.com/bwc/install/install.sh && chmod +x install.sh
./install.sh --user=st2admin --password='Ch@ngeMe' --license=${BWC_LICENSE_KEY}

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.

We can conclude there's something in sudo service st2chatops restart that doesn't interact well with pipes. The other services on el6 use the daemon function as opposed to nohup_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.init

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.

@warrenvw
Copy link
Author

warrenvw commented Nov 3, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants