ReadConfig reads config and unmarshals it from yaml into Config
(path string)
| 115 | log.Debugf("system uptime: %s", uptime) |
| 116 | |
| 117 | if uptime < c.BootDelay { |
| 118 | log.Infof("postponing startup by %s", c.BootDelay-uptime) |
| 119 | time.Sleep(c.BootDelay - uptime) |
| 120 | } |
| 121 | |
| 122 | return nil |
| 123 | } |
| 124 | |
| 125 | // uptime returns system boot time |
| 126 | func uptime() (time.Duration, error) { |
| 127 | var ts unix.Timespec |
| 128 | |
| 129 | if err := unix.ClockGettime(unix.CLOCK_BOOTTIME, &ts); err != nil { |
| 130 | return 0, err |
| 131 | } |
no outgoing calls
searching dependent graphs…