#!/bin/bash
#
# description: This init script runs near the end of the boot
# sequence and 1) starts the console logger 2) reports to the 
# console certain system and hardware properties, (ex: system memory, etc.).

# This script is written as a bash script, calling /usr/bin/EosInitReport
# so that we can use the existing startup mechanisms to report this.
# EosInitReport doesn't really fail even if some values aren't displayed,
# which is why we don't check return codes...also we don't want to
# display the OK/FAIL after this.


# Once we figure out what it means to "stop" Eos, add support to do
# that here.
case "$1" in
start)
    /usr/bin/EosInitReport
    # See BUG123878. During reboot we some time miss some lines from EosInitReport on some duts.
    # It seems like it's actually happening due to some bug in systemd due which it doesn't wait till
    # we finish all jobs including writing text on the terminal before moving on to next jobs.
    # Adding this sleep will make systemd to wait before moving on to next job. Hopefully, in newer
    # systemd version this gets fixed.
    sleep 1
    /usr/bin/conlogd
    ;;
stop)
   ;;
*)
    echo $"Usage: $0 {start}"
    exit 1
esac
