Core-Files in bestimmtes Verzeichnis schreiben lassen

cryptosteve

Ex-Steve`
Hi,

wie kann ich Corefiles, die von einem Programm erzeugt werden (hier vornehmlich kde-Programme und Firefox) in ein bestimmtes Verzeichnis schreiben lassen?

Gibt es eine solche Möglichkeit überhaupt? Der Umweg über crontabs, .zshrc, etc. ist mir bekannt, aber eher Flickwerk.
 
Steve` schrieb:
Hi,

wie kann ich Corefiles, die von einem Programm erzeugt werden (hier vornehmlich kde-Programme und Firefox) in ein bestimmtes Verzeichnis schreiben lassen?

Gibt es eine solche Möglichkeit überhaupt? Der Umweg über crontabs, .zshrc, etc. ist mir bekannt, aber eher Flickwerk.

Ist es nicht das was du willst?
man core schrieb:
The name of the file is controlled via the sysctl(8) variable
kern.corefile. The contents of this variable describes a filename to
store the core image to. This filename can be absolute, or relative
(which will resolve to the current working directory of the program gen-
erating it). Any sequence of %N in this filename template will be
replaced by the process name, %P by the processes PID, and %U by the UID.
The name defaults to %N.core, yielding the traditional FreeBSD behaviour.
[...]
EXAMPLES
In order to store all core images in per-user private areas under
/var/coredumps, the following sysctl(8) command can be used:
sysctl kern.corefile="/var/coredumps/%U/%N.core"
 
Hmm .. beim Überblättern hatte ich zunächst gedacht, dass sich das nur auf Kerneldumps bezieht. Die Ausgabe
Code:
[root@nexxus:/home/stell]# sysctl kern.corefile="/var/coredumps/%U/%N.core"
/preexec.core"] [/home/stell]kern.corefile: %N.core -> /var/coredumps/%U/%N.core
läßt aber darauf schließen, dass Du womöglich recht hast. Ich werde das testen. Danke erstmal.
 
Zurück
Oben