brdido
brdido

Reputation: 351

Startup script only executing after instance reboot

we have a startup-script that is working fine, but it only gets executed after reboot.

i'm updating gcutil to gcloud compute and centos6 to centos7.

I'm not sure if this has something to do with security issues (SElinux?).

Can someone please help me debugging this?

Facts: There startup-script log doesn't exist at instance creation. Also, in output console it says that there is no startup-scripts.

After rebooting, everything goes how it should.

Upvotes: 2

Views: 2371

Answers (2)

brdido
brdido

Reputation: 351

Editing /usr/share/google/run-startup-scripts to sleep for 30 seconds works.

Just add :

sleep 30 (You may also try lower intervals)

It is an immediate answer for the problem but it is far from being the real solution.

My clues and how I got here are im my comments

Upvotes: 2

Marius I
Marius I

Reputation: 1481

If I am not mistaking, the startup script executes only on system startup/reboot, so this should work as expected. Script gets executed after the machine is restarted. How are you passing it to the metadata server ? is it startup-script, startup-script-url, from GCS bucket ? I have seen "centos-7-v20141016" having issues processing startup scripts.

Upvotes: 0

Related Questions