From owner-freebsd-questions@freebsd.org Sun Jul 26 20:18:35 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2047C36A628 for ; Sun, 26 Jul 2020 20:18:35 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFDls3BqSz42Nb for ; Sun, 26 Jul 2020 20:18:33 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([178.5.224.215]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPA (Nemesis) id 1MYe6H-1kLyp31rJD-00VglS; Sun, 26 Jul 2020 22:18:30 +0200 Date: Sun, 26 Jul 2020 22:18:30 +0200 From: Polytropon To: Ernie Luzar Cc: "freebsd-questions@freebsd.org" Subject: Re: How to see shutdown log Message-Id: <20200726221830.f26e018f.freebsd@edvax.de> In-Reply-To: <5F1D8817.9090501@gmail.com> References: <5F1B8399.6000502@gmail.com> <20200725032502.5e0a272b.freebsd@edvax.de> <5F1D8817.9090501@gmail.com> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:adauFskOjMogMtevhxzozUImqW/lftmFGbOziUthBEVXgrR+Kf9 rLi5+iVu01kXKw5sgM9GjcZZouPsTjQznSezD2HDLje38W1RJZ4CLM9C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X-Rspamd-Queue-Id: 4BFDls3BqSz42Nb X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@edvax.de has no SPF policy when checking 212.227.17.10) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [3.28 / 15.00]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[178.5.224.215:received]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.13)[0.129]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.02)[0.022]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.73)[0.731]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[212.227.17.10:from]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_POSSIBLE(0.00)[212.227.17.10:from]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 20:18:35 -0000 On Sun, 26 Jul 2020 09:41:43 -0400, Ernie Luzar wrote: > Polytropon wrote: > > On Fri, 24 Jul 2020 20:58:01 -0400, Ernie Luzar wrote: > >> When you boot the system a bunch of messages roll across the screen to > >> fast to read. The dmesg -a command will show these to you to read at > >> your own pace. When you issue the shutdown or halt command a bunch of > >> different messages roll across the screen to fast to read. > >> > >> Is there a way view these messages after the system comes back up later? > > > > Yes, those are located to /var/log/messages, as long as > > file system access is possible; the last kernel messages > > therefore aren't being logged. > > > I checked and what is logged to /var/log/messages on host shutdown is no > were close to the messages I see fly past on the console terminal. The problem probably is that at a certain point, messages will only be written to terminal and to memory buffer, but not to a file because no file access is possible anymore (kernel still runs, but disks have been unmounted, so no VFS access can be done anymore). Messages in the RAM will not survive a reboot. However, those created at system startup are copied to the log file as soon as it becomes accessible. > This is real easy for people to test so give it a run. Sure. There is a possibility that might work, even though I have not tested it: You could "hijack" the kernel printing routine (the one that emits the messages) and have it copy characters to a line printer, a virtual one or a real one, and then you could see those messages. It would maybe also be possible to read the system console's file /dev/console and copy everything that is written to it to /dev/lpt0. > Thinking maybe something else is controlling what goes to the message > file on shutdown. Have any ideas where I should look? Basically, /var/log/messages contains all messages created with the system logging mechanism. When programs decide to emit messages by a simple printf() to whatever is their controlling terminal, those won't be logged. To get those messages, checking the console buffer (rather than the system message buffer) is probably a better way to do. Again, note that file access is made impossible at a certain stage during system shutdown that is usually followed by other stages that also can print messages. If you really want to get those messages, you need a way to capture them independently from anything that is a log file unter VFS control... -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...