Skip to content
This repository has been archived by the owner on Apr 7, 2018. It is now read-only.

RELX_REPLACE_OS_VARS boot script fails on awk with env vars containing certain characters #390

Closed
novaugust opened this issue Sep 9, 2016 · 3 comments

Comments

@novaugust
Copy link

novaugust commented Sep 9, 2016

we had an environment variable, export DB_PASSWORD='Pntu>x9hC<6&zX:e' that prevented the boot script from getting anywhere, freezing in this area

if [ $RELX_REPLACE_OS_VARS ]; then
    awk '{while(match($0,"[$]{[^}]*}")) {var=substr($0,RSTART+2,RLENGTH -3);gsub("[$]{"var"}",ENVIRON[var])}}1' < $SYS_CONFIG > $SYS_CONFIG.2.config
    SYS_CONFIG=$SYS_CONFIG.2.config
fi

source on GH

changing to another password fixed the script and got our app up and running.

@bitwalker
Copy link
Owner

Interesting, I'll have to dig in to awk a bit to figure out why it's choking on that string. Thanks for reporting!

@novaugust
Copy link
Author

Just had this happen with another password. Seems like the bad character is the &

@bitwalker
Copy link
Owner

@novaugust I fixed this in distillery, but haven't yet ported the fix to exrm. You can see the commit where I did so referenced above. I'll push the fix to exrm as soon as I'm able.

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

No branches or pull requests

2 participants