Start a Conversation

Unsolved

This post is more than 5 years old

1083

April 3rd, 2018 13:00

ScaleIO Gateway Debian Package postinst hangs when using ansible

Hi all, not sure if there is a better place to report a bug. I've run into an interesting issue while deploying scaleio gateway with ansible. Lets start at the root of the issue. I'm installing version 2.5-0.254 on Ubuntu 16.04. The problem point is with /var/lib/dpkg/info/emc-scaleio-gateway.postinst when it initially run, a random password is generated. The following line with associated line number is where the post install hangs.


958     randomPass=$(strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 30 | tr -d '\n'; echo)

So why does it hang? Because ansible is trapping signals when the native package management modules are used (apt, yum etc) `strings /dev/urandom` never receives the pipe close from head -n 30 after it closes stdin once 30 lines are read; CPUs proceed to create lots of heat.


This method of generating a random password is prone to errors like this. A better option would be to read only the specific number of characters desired from /dev/urandom, or attempt to stop trapping pipes

$(trap - PIPE; strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 30 | tr -d '\n'; echo)

Another solution to this issue is to utilize a wrapper script from ansible and bypass all of the ansible modules for OS package management, but this is counter intuitive at best. Thanks for your time!

Etrik

306 Posts

April 9th, 2018 05:00

Hi Etrik,

Many thanks for catching this - I will let our Dev know to look for  similar issues in the future, but please note it's Ansible problem, not the installer itself - I believe it works fine when you install as per Install Guide ;-)

Cheers,

Pawel

No Events found!

Top