11-06-2008
Hi All
This section will show three different examples of creating core files. All of the examples will use the application top to create core files. The examples will be as follows:
1. Create a core file in the default pattern with an appended PID
2. Create a core file in a designated directory
3. Create a core file using % specifiers
Create a Core File In The Default Pattern With An Appended PID
Complete the following to take a core of the top program in the default pattern with and appended PID (logged in as root):
# ulimit -c unlimited
# echo 1 > /proc/sys/kernel/core_uses_pid
# cat /proc/sys/kernel/core_pattern
core
# top &
[1] 20992
# kill -6 20992
[1]+ Stopped top
# fg %1
top
Aborted (core dumped)
# ls core*
core.20992
Please note that the kill command uses the processes PID and the PID of the process will always be different
Create a Core File In a Designated Directory
Complete the following to take a core of the top program with the core file being saved in a specific directory (logged in as root):
# ulimit -c unlimited
# echo 1 > /proc/sys/kernel/core_uses_pid
# mkdir /corefiles
# chmod 777 /corefiles
# echo /corefiles/core > /proc/sys/kernel/core_pattern
# top &
[1] 20992
# kill -6 20123
[1]+ Stopped top
# fg %1
top
Aborted (core dumped)
# ls /corefiles/core*
core.20123
Please note that the kill command uses the processes PID and the PID of the process will always be different
Create a Core File Using % Specifiers
Complete the following to take a core of the top program using % specifiers (logged in as root):
# ulimit -c unlimited
# echo 1 > /proc/sys/kernel/core_uses_pid
# echo /corefiles/core-%e-%p-%t > /proc/sys/kernel/core_pattern
# top &
[1] 24340
# kill -6 24340
[1]+ Stopped top
# fg %1
top
Aborted (core dumped)
# ls /corefiles/core*
core-top-24340-1129845522
In this example the core file is created in the /corefiles directory. Notice the core filename includes the executable name, PID, and the time of the core. Notice also that the PID wasn't appended to the core filename. The PID is not appended if the %p specifier is used in the filename.
5 More Discussions You Might Find Interesting
1. UNIX Desktop Questions & Answers
I'm trying to set up a school Linux computer and use Samba to link it to Windows NT.
Pentium-133
Hercules 8 meg Stingray 128/3D
I'm not too familiar with SuSE's config tools (more used to Mandrake) and so am having some trouble configuring X. SaX2 just won't start, even when I use "sax2... (1 Reply)
Discussion started by: HumanBeanDip
1 Replies
2. Solaris
I am trying to set up coredumps on a server, I have enabled the coreadm, and have also set a path to whre the coredumps will go.
I now need to set the ulimit , as this is set to 0. I made the change:
ulimit -c 8192
but when I logged out and back in, it was set back to 0 again. I need to know... (1 Reply)
Discussion started by: mzyvn6
1 Replies
3. SuSE
Hey,
I was wondering if anybody could help me setup my PhpMyAdmin on my SUSE linux 9.1 machine. I want to use it to access MySQL server instead of the defualt MySQLCC-Console Manager.
I have not tried yet but i have done a such and it's installed in one of the folders.
I would like to point... (15 Replies)
Discussion started by: sybella1
15 Replies
4. UNIX for Dummies Questions & Answers
Hello, I'm a newbie to unix. I just about have the Suse 10.1 installed. During set up it automatically detected components to access the internet. But failed. I lost now.
Any ideas?
Thank You (2 Replies)
Discussion started by: Nick7269
2 Replies
5. Shell Programming and Scripting
I am trying to use telnet to access a linux box. I know I should be using SSH (which I use personally), but i have to use telnet. How do I configure the linux box to accept the telnet request.
I am using Suse
Thanks for any help (11 Replies)
Discussion started by: salil2012
11 Replies
build(1) General Commands Manual build(1)
NAME
build - build SuSE Linux RPMs in a chroot environment
SYNOPSIS
build [--clean|--no-init] [--rpms path1:path2:...] [--arch arch1:arch2:...] [--root buildroot] [specfile|srcrpm]
build --help
build --verify
DESCRIPTION
build is a tool to build SuSE Linux RPMs in a safe and clean way. build will install a minimal SuSE Linux as build system into some direc-
tory and will chroot to this system to compile the package. This way you don't risk to corrupt your working system (due to a broken spec
file for example), even if the package does not use BuildRoot.
build searches the spec file for a BuildRequires: line; if such a line is found, all the specified rpms are installed. Otherwise a selec-
tion of default packages are used. Note that build doesn't automatically resolve missing dependencies, so the specified rpms have to be
sufficient for the build.
If a spec file is specified on the command line, build will use this file and all other files in the directory for building the package. If
a srcrpm is specified, build automatically unpacks it for the build. If neither is given, build will use all the specfiles in the current
directory.
OPTIONS
--clean
remove the build system and reinitialize it from scratch.
--no-init
skip the build system initialization and start with build immediately.
--list-state
list rpms that would be used to create a fresh build root. Does not create the build root or perform a build.
--rpms path1:path2:path3...
Where build can find the SuSE Linux RPMs needed to create the build system. This option overrides the BUILD_RPMS environment vari-
able.
--arch arch1:arch2:arch3...
What architectures to select from the RPMs. build automatically sets this to a sensible value for your host if you don't specify
this option.
--root buildroot
Specifies where the build system is set up. Overrides the BUILD_ROOT enviroment variable.
--useusedforbuild
Tell build not to do dependency expansion, but to extract the list of packages to install from "# usedforbuild" lines or, if none
are found, from all "BuildRequires" lines. This option is useful if you want to re-build a package from a srcrpm with exactly the
same packages used for the srcrpm build.
--norootforbuild
--help Print a short help text.
--verify
verify the files in an existing build system.
.spec FILE OPTIONS
The build command interprets some special control comments in the specfile:
# norootforbuild
# needsrootforbuild
build uses either user root or user abuild in the build system to do the build. For non-SUSE distros as well as since SUSE 10.2,
the default build user is abuild. For 10.2 and before, the default build user is root. These two flags in the spec file allow to
deviate from the defaults and force-set the build user to abuild and root (for # norootforbuild and # needsrootforbuild respec-
tively.
# needsbinariesforbuild
provide the binary rpms that have been used to set up the build root in /.build.binaries within the build root.
ENVIRONMENT
BUILD_ROOT
The directory where build should install the chrooted build system. "/var/tmp/build-root" is used by default.
BUILD_RPMS
Where build can find the SuSE Linux RPMs. build needs them to create the build system. "/media/dvd/suse" is the default value
which will do the trick if you have the SuSE Linux DVD mounted.
BUILD_RPM_BUILD_STAGE
The rpm build stage (-ba, -bb, ...). This is just passed through to rpm, check the rpm manpage for a complete list and descrip-
tions. "-ba" is the default. You can use this to add more options to RPM.
SEE ALSO
rpm(1),
Maximum RPM:
http://www.rpm.org/max-rpm/
cross distribution packaging:
http://en.opensuse.org/Build_Service/cross_distribution_package_how_to
SUSE packaging standards and guidelines:
http://en.opensuse.org/Packaging
(c) 1997-2008 SuSE Linux AG Nuernberg, Germany build(1)