30

In Google Cloud Platform's Ubuntu 16.04.1 instance, the output of my startup script was written to /var/log/startupscript.log.

Since they upgraded to 16.04.02 I can't find the logs anymore.

Any idea?

GalloCedrone
  • 4,869
  • 3
  • 25
  • 41
Christian Daguerre
  • 301
  • 1
  • 3
  • 3

3 Answers3

31

The correct answer (by now) is to use journalctl:

sudo journalctl -u google-startup-scripts.service

You can re-run a startup script like this:

sudo google_metadata_script_runner startup

See also: https://cloud.google.com/compute/docs/instances/startup-scripts/linux

Overbryd
  • 4,612
  • 2
  • 33
  • 33
29

UPDATE from the official documentation:

Startup script output is written to the following log files:

  • CentOS and RHEL: /var/log/messages

  • Debian: /var/log/daemon.log

  • Ubuntu 14.04, 16.04, and 16.10: /var/log/syslog
  • SLES 11 and 12: /var/log/messages
d-_-b
  • 21,536
  • 40
  • 150
  • 256
GalloCedrone
  • 4,869
  • 3
  • 25
  • 41
-1

There are two ways to search for the log file probably a lot more but i know the below.

  1. locate -i startupscript.log - you may need to update your indexes periodically for this option to be optimal.
  2. From root find / -iname startupscript.log -print .
Govna
  • 348
  • 1
  • 4
  • 16
  • I actually tried this, but there is no script with that name anymore and I have checked all files showing up through `find / -iname *.log -print` – Christian Daguerre Mar 14 '17 at 13:19
  • I read this post about some users missing their /var/log/journal directory after they upgraded which is where their boot log information should be going. Granted they didnt state that they were on a Google Cloud platform so it could be different. [Link to Ask Ubuntu Form post](http://askubuntu.com/questions/765315/how-to-find-previous-boot-log-after-ubuntu-16-04-restarts) – Govna Mar 14 '17 at 15:46