hi the way you run the commands probably can re reviewed
when using sudo is just one command so this command i think wont do what you want sudo scl enable devtoolset-8 bash but if you remove the sudo scl enable devtoolset-8 bash not sure will work, if i do a search it seems you should be using something like source scl_source enable devtoolset-8 so check the documentation of devtoolset-8 how you are supposed to source the environment from a script you can try like this # installing sudo yum install -y centos-release-scl sudo yum groupinstall "Development Tools" -y && sudo yum install -y devtoolset-8 # checking 1 scl enable devtoolset-8 bash echo "Checking enabled SCL's" echo $X_SCLS echo "changing to Redis Directory" cd $LOSANT_DIR/redis-6.0.5 echo "verifying the SCL before the code compillation" echo $X_SCLS # checking 2 source scl_source enable devtoolset-8 bash echo "Checking enabled SCL's" echo $X_SCLS echo "changing to Redis Directory" cd $LOSANT_DIR/redis-6.0.5 echo "verifying the SCL before the code compillation" echo $X_SCLS alvaro On Thu, Jul 16, 2020 at 10:47 PM Nandeep Mannava <[email protected]> wrote: > I am trying to build a centos-7 AMI with a packer. I am installing and > enabling software collections packages in the shell script > > >> #!/bin/bash >> >> set -e >> >> >> sudo yum install -y centos-release-scl >> >> sudo yum groupinstall "Development Tools" -y && sudo yum install -y >> devtoolset-8 >> >> sudo scl enable devtoolset-8 bash >> >> echo "Checking enabled SCL's" >> echo $X_SCLS >> echo "changing to Redis Directory" >> cd $LOSANT_DIR/redis-6.0.5 >> echo "verifying the SCL before the code compillation" >> echo $X_SCLS >> > > echo $X_SCLS must show a list of enabled software collections. When I am >> running from packer I am getting an empty list. > > > Can someone please help me. > > Thanks, > Nandeep. > > -- > This mailing list is governed under the HashiCorp Community Guidelines - > https://www.hashicorp.com/community-guidelines.html. Behavior in > violation of those guidelines may result in your removal from this mailing > list. > > GitHub Issues: https://github.com/hashicorp/packer/issues > IRC: #packer-tool on Freenode > --- > You received this message because you are subscribed to the Google Groups > "Packer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/packer-tool/dbaca783-2a55-4a23-a7f2-e82384898c6do%40googlegroups.com > <https://groups.google.com/d/msgid/packer-tool/dbaca783-2a55-4a23-a7f2-e82384898c6do%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Alvaro -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/hashicorp/packer/issues IRC: #packer-tool on Freenode --- You received this message because you are subscribed to the Google Groups "Packer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CAHqq0ex%3DxQM70L3Cgo65yWgKkYdgMuEOXXhHoj0sy%3DDEk9%2Bc%3Dg%40mail.gmail.com.
