1
0
mirror of https://github.com/rancher/os.git synced 2025-08-31 14:23:11 +00:00

This makes early initrd logging work

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit
2017-07-12 15:17:03 +10:00
parent bb20e96a98
commit bf98a1ae3f
5 changed files with 10 additions and 3 deletions

View File

@@ -95,6 +95,8 @@ func sysInit(c *config.CloudConfig) (*config.CloudConfig, error) {
func MainInit() {
log.InitDeferedLogger()
log.Infof("MainInit() start")
defer log.Infof("MainInit() finish")
if err := RunInit(); err != nil {
log.Fatal(err)
}
@@ -414,6 +416,7 @@ func RunInit() error {
return err
}
log.Infof("RunInit() finished")
log.SyslogReady(true)
return pidOne()

View File

@@ -163,7 +163,7 @@ func InitDeferedLogger() {
func SyslogReady(logHook bool) error {
if userHook != nil {
if logHook {
logrus.Infof("Starting Syslog Hook")
Infof("------------info Starting defered Syslog Hook (%s)", os.Args[0])
fmt.Fprintf(appLog.Out, "------------ Starting defered Syslog Hook (%s) ----------------\n", os.Args[0])
} else {
fmt.Fprintf(appLog.Out, "------------ Starting Syslog Hook (%s) ----------------\n", os.Args[0])

View File

@@ -69,6 +69,8 @@ func (hook *ShowuserlogHook) LogSystemReady() error {
hook.syslogHook = h
for _, entry := range hook.storedEntries {
line, _ := entry.String()
fmt.Printf("---- CATCHUP %s\n", line)
hook.syslogHook.Fire(entry)
}
}

View File

@@ -1 +1,3 @@
APPEND rancher.debug=true rancher.autologin=tty1 rancher.autologin=ttyS0 rancher.autologin=ttyS1 console=tty0 console=ttyS0 console=ttyS1 printk.devkmsg=on ${APPEND}
#APPEND rancher.console=ttyS1 rancher.debug=true rancher.autologin=tty1 rancher.autologin=ttyS0 rancher.autologin=ttyS1 console=tty0 console=ttyS0 console=ttyS1 printk.devkmsg=on ${APPEND}
APPEND rancher.console=ttyS1 rancher.debug=true rancher.autologin=tty1 rancher.autologin=ttyS0 rancher.autologin=ttyS1 console=tty0 console=ttyS0 printk.devkmsg=on ${APPEND}

View File

@@ -277,7 +277,7 @@ if [ "$GUICONSOLE" == "" ]; then
if [ "$NETCONSOLE" == "1" ]; then
# put ttyS1 on port 4444
DISPLAY_OPTS="${DISPLAY_OPTS} -serial tcp::4444,server"
KERNEL_ARGS="console=ttyS1 rancher.autologin=ttyS1 ${KERNEL_ARGS}"
KERNEL_ARGS="rancher.console=ttyS1 rancher.autologin=ttyS1 ${KERNEL_ARGS}"
fi
fi