We help IT Professionals succeed at work.

Controlling core file location & name

jlargent
jlargent asked
on
Medium Priority
240 Views
Last Modified: 2010-04-21
I have a shell script that starts several processes as
background processes.  Currently when one of them cores it
writes the core file to the same location with the core
filename.  Is there a way to force the core to a particular
directory with a specified name?
Comment
Watch Question

ozo
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2015

Commented:
cd /name1; process1 &
cd /name2; process2 &

Author

Commented:
That's ok for a few processes, but in my situation there
are more than 10 and I would rather not have multiple
directories if there is any other way.  Also, the processes
live in a common directory so the cmd would be:
cd /name1; /path/process1 &
cd /name2; /path/process2 &
I'm not sure if the core file would be dumped in the
"name1" directory or the "path" directory.
thanks

Author

Commented:
Adjusted points to 200
core file is in the name1 directory.
You must patch your kernel to satisfy your goal.
Sorry for bad news.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Is patching the kernal the standard way to handle this?
Has this problem never been addressed by anyone else. Is
really common practise that all core files are created
in one area with the same name (thus overwriting previous
core files)?
ozo
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2015

Commented:
cd /name1; /path/process1 || mv core core1.$$ &

(assuming that process1 doesn't fail other than by core dump)
> Has this problem never been addressed by anyone else.
Well, may be that there are millions of coredumps. But it seems that there is noone who whants to fix them simultaneously :)
My answer or ozo's comment.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.