GCP Startup Script Execution location

Viewed 1459

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,

2 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.

Related