1. Debug the script using -x option. Redirect everything to some log file.
} >> /root/test.log
2. Insted of exec use full path like /bin/exec.
3. Call your script from /etc/rc.local file and then delete it after firstboot. You can do it by writing another shell script.
If this wont work then please upload /root/test.log so that we can debug more.
What is the status of your error now?
Did you manage what was happened?
Thanks for the suggestion chorgeas. I'm creating the build now with those tips and will have an output soon.
After thinking about this overnight, I realized that the statements used are bash specific. The issue is reproducible if I were to execute with sh (e.g. /bin/sh /opt/vmware/etc/isv/firstboot). So it seems that even though the firstboot file starts with "!#/bin/bash", the shell executing it isn't bash.
I was misled by the templates default first boot script that starts with "!#/bin/bash."
As a workaround, I performed the following:
- Created a script with the desired content
- Packaged it via "mkpkg"
- Saved the resulted deb package to default application repository (i.e. /opt/vmware/www/ISV/appliancePackages)
- Edit the profile's first boot script to execute the script with the desired shell. (e.g. /bin/bash /root/customfirstbootscript)
Looks like most of VMWare Studio's builtin templates have "!#/bin/bash" in their first boot and subsequent boot script templates. As a follow up question, how is the first boot script being executed?