Automatic backtrace [Was: Re: NetAPP/Samba 3.0/plugs]

Andrew Bartlett abartlet at pcug.org.au
Wed Mar 13 13:48:02 GMT 2002


> "Esh, Andrew" wrote:
> 
> Can the smbd process pid be passed to a panic action?

Yes, %d.  I have a panic action that opens an xterm with gdb already in
it.

What I think would be nice is if we could make the stdout/stderr of
'panic action' end up in the current logfile.  That should not be that
hard actually...

Then, by using echo "bt full" | gdb /proc/%d/exe %d  we have the
backtrace in the logfile.  The tricky bit is getting the path to the exe
and the gdb stuff portably, not the actual script.

Watch out, this script is open to symlink attacks - the $$ is
predictable.

Andrew Bartlett

-- 
Andrew Bartlett                                 abartlet at pcug.org.au
Manager, Authentication Subsystems, Samba Team  abartlet at samba.org
Student Network Administrator, Hawker College   abartlet at hawkerc.net
http://samba.org     http://build.samba.org     http://hawkerc.net




More information about the samba-technical mailing list