#1565 Print log message on shutdown

Reporter Stephen Paul Weber
Owner Nobody
Created
Updated
Stars ★ (1)
Tags
  • Type-Defect
  • Status-NeedInfo
  • Priority-Medium
  1. Stephen Paul Weber on

    Sometimes my prosody instance restarts, and there is nothing interesting in even the debug log to say why, for example here is the most recent one: Jun 10 13:40:07 stanzarouter debug Unhandled s2sin stanza: presence; xmlns=jabber:client Jun 10 13:40:07 s2sout5559c9f4dc90 debug Sending[s2sout]: <presence from='...' type='error' id='9e38cd7f-3d4e-4306-a8e2-678e0476f0cd' to='...'> Jun 10 13:40:08 s2sin5559bdbf64d0 debug Received[s2sin]: <presence id='d191a707-8664-4079-b488-7b7099c83500' from='...' xml:lang='en' to='...'> Jun 10 13:40:08 stanzarouter debug Unhandled s2sin stanza: presence; xmlns=jabber:client Jun 10 13:40:08 s2sout5559c9f4dc90 debug Sending[s2sout]: <presence from='...' type='error' id='d191a707-8664-4079-b488-7b7099c83500' to='...'> Jun 10 13:40:09 c2s5559babe09a0 debug Received[c2s]: <iq from='...' type='get' id='c2s1' to='...'> Jun 10 13:40:09 c2s5559babe09a0 debug Sending[c2s]: <iq from='...' type='result' id='c2s1' to='...'> Jun 10 13:40:09 s2sin5559bdbf64d0 debug Received[s2sin]: <presence id='b16c1d21-6a36-4ba9-8368-586177c65da3' from='...' xml:lang='en' to='...'> Jun 10 13:40:09 stanzarouter debug Unhandled s2sin stanza: presence; xmlns=jabber:client Jun 10 13:40:09 s2sout5559c9f4dc90 debug Sending[s2sout]: <presence from='...' type='error' id='b16c1d21-6a36-4ba9-8368-586177c65da3' to='...'> Jun 10 13:40:11 startup info Hello and welcome to Prosody version 0.11. Now, of course, there is a small chance that something on the system may have sent SIGTERM or similar instead of this being caused by a crash, but in that case I would expect to find a log line saying "Shutting down..." or similar. # Version information Prosody 0.11.4 # Prosody directories Data directory: /var/lib/prosody Config directory: /etc/prosody Source directory: /usr/lib/prosody Plugin directories: /usr/local/lib/prosody/modules/ - prosody-modules rev: e3964f876b5d /usr/lib/prosody/modules/ # Lua environment Lua version: Lua 5.2 Lua module search paths: /usr/lib/prosody/?.lua /usr/local/share/lua/5.2/?.lua /usr/local/share/lua/5.2/?/init.lua /usr/local/lib/lua/5.2/?.lua /usr/local/lib/lua/5.2/?/init.lua /usr/share/lua/5.2/?.lua /usr/share/lua/5.2/?/init.lua Lua C module search paths: /usr/lib/prosody/?.so /usr/local/lib/lua/5.2/?.so /usr/lib/x86_64-linux-gnu/lua/5.2/?.so /usr/lib/lua/5.2/?.so /usr/local/lib/lua/5.2/loadall.so LuaRocks: Not installed # Network Backend: libevent epoll # Lua module versions DBI: 0.7 lfs: LuaFileSystem 1.6.3 libevent: 2.1.8-stable luaevent: 0.4.6 lxp: LuaExpat 1.3.0 socket: LuaSocket 3.0-rc1 ssl: 0.6

  2. Zash on

    Hello. I'm confused as to what this issue is about. Prosody already logs a number of messages about shutting down if it's done normally, so the log snippet looks either like a crash followed by an automatic restart, or another instance being started and writing to the same log file. If it crashed, there should be a hint of this in the system or kernel logs, so look there.

    Changes
    • tags Status-NeedInfo
  3. Stephen Paul Weber on

    wouldn't I expect to see a backtrace if it crashed?

  4. Zash on

    No, backtraces on crashes are very rare. An error severe enough to cause a crash would not leave any room for writing to the log file. If this happens in Lua land, there may be a traceback printed on standard output, which isn't the log file, but this is very rare. Most Lua errors are handled and logged, and then Prosody keeps going, which means it does *not* crash. Errors in C land on the other hand may result in a segmentation fault, which means the process dies, leaving no room for preparing a traceback or even logging anything. That may however produce a core dump, from which a stack trace could be extracted. It definitely should be logged in the system or kernel log however, so, again, look there.

New comment

Not published. Used for spam prevention and optional update notifications.