Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCP Startup Script Execution location

By Default GCP VM instances are executing startup script in the /tmp location.

But in my customized ubuntu OS, I have restriction on /tmp location not to execute anything in this location due to security reasons.

Is there anyway to change the default execution path of startup script.

Thanks,

like image 508
victor Avatar asked Jun 19 '26 11:06

victor


1 Answers

Yes you can!

1.You need to go into your VM's /etc/default/instance_configs.cfg

2.If the file exists, open it and move to [Metadata] section.

3.You may see a “run_dir = ” line which directs the script’s target running folder. You can edit it to set an alternative run directory, for example, /home.

4.Test if the error persists.

like image 105
ankush handa Avatar answered Jun 21 '26 07:06

ankush handa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!