0

How to generate stack trace in golang process when the session which started the process is closed.

I have tried SIGQUIT. It generates the stack trace and prints it on stdout. However, its not helpful when the session which started the process is closed. Is there any other way of doing it?

user3881147
  • 21
  • 1
  • 4
  • https://stackoverflow.com/questions/19094099/how-to-dump-goroutine-stacktraces – Mark Feb 04 '18 at 22:27
  • Possible duplicate of [How to dump goroutine stacktraces?](https://stackoverflow.com/questions/19094099/how-to-dump-goroutine-stacktraces) – Marc Feb 05 '18 at 07:19
  • Have to tried to see what signal your process is receiving? If you're asking about a process, a shell usually sends SIGHUP to end child processes. – JimB Feb 05 '18 at 13:51
  • I was using telegraf (go process). In my case, when the session was closed, I tried SIGKILL, the dump was being redirected to journalctl which worked for me. It took a while for me to figure this out – user3881147 Mar 29 '18 at 07:05

0 Answers0