crashtar

View: New views
6 Messages — Rating Filter:   Alert me  

crashtar

by Mikolaj Golub-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

http://trociny.googlecode.com/files/crashtar

This simple script is useful for me and might be useful for other people
too. The script creates tar archive that contains all files needed for
debugging FreeBSD kernel crash (vmcore, kernel, loaded modules, sources that
appear in backtrace). This is useful e.g. for debugging a crash on another
host, sending it to developers or if you are going to upgrade the kernel on
crashed host but would like to keep crashdump in case the developers ask you
to provide additional info.

Created tar contains also a script that when being run inside unpacked archive
will give kgdb(1) session with crash core loaded in it. The script should be
run with root privileges because it does chroot(8) before starting kgdb(1).

I think I don't have to warn here that a crashdump may be sent only to person
you trust :-).

--
Mikolaj Golub
_______________________________________________
freebsd-hackers@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..."

Parent Message unknown Re: crashtar

by Alexander Best :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

thanks. this is a cool script and very useful indeed. only thing you might
want to do is check for root privileges at the beginning to avoid nasty error
messages like.

awk: can't open file /var/crash/info.0
 source line number 12

thanks again.
alex
_______________________________________________
freebsd-hackers@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..."

Re: crashtar

by Mikolaj Golub-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sat, 10 Oct 2009 12:34:05 +0200 (CEST) Alexander Best wrote:

 AB> thanks. this is a cool script and very useful indeed. only thing you might
 AB> want to do is check for root privileges at the beginning to avoid nasty error
 AB> messages like.

 AB> awk: can't open file /var/crash/info.0
 AB>  source line number 12

In some cases you might not need root privileges. E.g. on some servers I don't
have root but SA gives me read access to crashdumps. In this case if the
script had a check for root privileges I would not be able to use it.

Actually as for me the message looks informative enough, it says that we have
some problems with accessing crash dump files, so permissions should be
checked.

--
Mikolaj Golub
_______________________________________________
freebsd-hackers@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..."

Re: crashtar

by Alexander Best :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mikolaj Golub schrieb am 2009-10-10:

> On Sat, 10 Oct 2009 12:34:05 +0200 (CEST) Alexander Best wrote:

>  AB> thanks. this is a cool script and very useful indeed. only thing
>  you might
>  AB> want to do is check for root privileges at the beginning to
>  avoid nasty error
>  AB> messages like.

>  AB> awk: can't open file /var/crash/info.0
>  AB>  source line number 12

> In some cases you might not need root privileges. E.g. on some
> servers I don't
> have root but SA gives me read access to crashdumps. In this case if
> the
> script had a check for root privileges I would not be able to use it.

> Actually as for me the message looks informative enough, it says that
> we have
> some problems with accessing crash dump files, so permissions should
> be
> checked.

alright then. :)

again: great script. would be great to have this in the ports dir in the near
future.

cheers.
alex
_______________________________________________
freebsd-hackers@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..."

Re: crashtar

by k-20 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mikolaj Golub wrote:

> On Sat, 10 Oct 2009 12:34:05 +0200 (CEST) Alexander Best wrote:
>
>  AB> thanks. this is a cool script and very useful indeed. only thing you might
>  AB> want to do is check for root privileges at the beginning to avoid nasty error
>  AB> messages like.
>
>  AB> awk: can't open file /var/crash/info.0
>  AB>  source line number 12
>
> In some cases you might not need root privileges. E.g. on some servers I don't
> have root but SA gives me read access to crashdumps. In this case if the
> script had a check for root privileges I would not be able to use it.
>
> Actually as for me the message looks informative enough, it says that we have
> some problems with accessing crash dump files, so permissions should be
> checked.
>

Instead of checking for root you could check if the file is readable:

if [ -r FILE ]

and then print an error message.

Although the awk error message is sufficient some people might find this
helpful.

Regards,
Andrew
_______________________________________________
freebsd-hackers@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..."

Re: crashtar

by Mikolaj Golub-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Tue, 13 Oct 2009 22:50:44 +0200 (CEST) Alexander Best wrote:

 AB> again: great script. would be great to have this in the ports dir in the near
 AB> future.

I have created separate google project for this script

http://code.google.com/p/bsdcrashtar/

And submitted to ports

http://www.freebsd.org/cgi/query-pr.cgi?pr=139721

BTW, many things in the script have been improved since I posted it here, and
user friendly error output is among them :-).

--
Mikolaj Golub
_______________________________________________
freebsd-hackers@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@..."