{"id":72,"date":"2008-01-02T13:57:02","date_gmt":"2008-01-02T05:57:02","guid":{"rendered":"http:\/\/blog.urdada.net\/2008\/01\/02\/72\/"},"modified":"2008-01-27T10:36:23","modified_gmt":"2008-01-27T02:36:23","slug":"change-the-core-dump-file-name-in-linux-and-freebsd","status":"publish","type":"post","link":"https:\/\/dada.tw\/blog\/2008\/01\/02\/72\/","title":{"rendered":"Change the core dump file name in Linux and FreeBSD"},"content":{"rendered":"<p>Following the <a href=http:\/\/blog.urdada.net\/2007\/12\/31\/71\/ target=_blank>previous notes<\/a> about enabling core dump, here&#8217;s a note about changing the filename of core dump.<\/p>\n<p>In Linux (since Linux 2.6 and 2.4.21)<br \/>\nyou can change the core dump filename from the file \/proc\/sys\/kernel\/core_pattern<\/p>\n<pre class=mono>\r\n         %%  A single % character\r\n         %p  PID of dumped process\r\n         %u  real UID of dumped process\r\n         %g  real GID of dumped process\r\n         %s  number of signal causing dump\r\n         %t  time of dump (seconds since 0:00h, 1 Jan 1970)\r\n         %h  hostname (same as 'nodename' returned by uname(2))\r\n         %e  executable filename\r\n<\/pre>\n<p>Linux have a default core filename pattern of &#8220;core&#8221;.<br \/>\nAlternatively, if \/proc\/sys\/kernel\/core_uses_pid contains a non-zero value, then the core dump file name will include a suffix .PID (process id), ex: core.PID<\/p>\n<p>In FreeBSD, sysctl variable &#8220;kern.corefile&#8221; controls the filename of core dump.<\/p>\n<pre class=mono>\r\nAny sequence of %N in this filename template will be replaced by\r\nthe process name, %P by the processes PID, and %U by the UID.\r\n<\/pre>\n<p>FreeBSD have a default core filename pattern of &#8220;%N.core&#8221;<\/p>\n<p>You can include path in the filename pattern both in Linux and FreeBSD.<br \/>\nThis make it possible to put core dump file in a separated directory.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Following the previous notes about enabling core dump,  [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[],"class_list":["post-72","post","type-post","status-publish","format-standard","hentry","category-os"],"views":5192,"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pubdi-1a","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":71,"url":"https:\/\/dada.tw\/blog\/2007\/12\/31\/71\/","url_meta":{"origin":72,"position":0},"title":"Enable core dump in Linux and FreeBSD","author":"dada","date":"2007-12-31","format":false,"excerpt":"Just a note. You can enable core dump by: [bash] e\u2026","rel":"","context":"\u5728\u300c\u4f5c\u696d\u7cfb\u7d71\u300d\u4e2d","block_context":{"text":"\u4f5c\u696d\u7cfb\u7d71","link":"https:\/\/dada.tw\/blog\/category\/comp\/os\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":84,"url":"https:\/\/dada.tw\/blog\/2008\/04\/18\/84\/","url_meta":{"origin":72,"position":1},"title":"Bypass the 2GB file size limit on 32-bit Linux","author":"dada","date":"2008-04-18","format":false,"excerpt":"Bypass the 2GB file size limit on 32-bit Linux (\u5728 \u2026","rel":"","context":"\u5728\u300c\u4f5c\u696d\u7cfb\u7d71\u300d\u4e2d","block_context":{"text":"\u4f5c\u696d\u7cfb\u7d71","link":"https:\/\/dada.tw\/blog\/category\/comp\/os\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":64,"url":"https:\/\/dada.tw\/blog\/2006\/10\/06\/64\/","url_meta":{"origin":72,"position":2},"title":"svndumpfilter with wildcards support ?","author":"dada","date":"2006-10-06","format":false,"excerpt":"Subversion \u7684 svnadmin obliterate \u529f\u80fd\u4e00\u76f4\u6c92\u6709\u5be6\u4f5c\u51fa\u4f86\uff0c\u9019\u5be6\u5728\u662f\u6709\u9ede\u2026","rel":"","context":"\u5728\u300c\u8edf\u9ad4\u300d\u4e2d","block_context":{"text":"\u8edf\u9ad4","link":"https:\/\/dada.tw\/blog\/category\/comp\/software\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":69,"url":"https:\/\/dada.tw\/blog\/2007\/12\/24\/69\/","url_meta":{"origin":72,"position":3},"title":"Script: \u53d6\u5f97 FreeBSD CVSUP \u7684\u66f4\u65b0\u72c0\u614b","author":"dada","date":"2007-12-24","format":false,"excerpt":"\u9019\u662f\u4eca\u5e741\u6708\u5beb\u7684 script... \u7528\u4f86\u76e3\u63a7\u5404\u5927 FreeBSD CVSUP mirror \u7db2\u7ad9\u7684\u2026","rel":"","context":"\u5728\u300c\u8edf\u9ad4\u300d\u4e2d","block_context":{"text":"\u8edf\u9ad4","link":"https:\/\/dada.tw\/blog\/category\/comp\/software\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65,"url":"https:\/\/dada.tw\/blog\/2007\/11\/20\/65\/","url_meta":{"origin":72,"position":4},"title":"\u6d88\u5931\u7684\u786c\u789f\u7a7a\u9593","author":"dada","date":"2007-11-20","format":false,"excerpt":"\u8a71\u8aaa\u67d0\u4e00\u5929\uff0c\u4e00\u4f4d\u540c\u4e8b\u767c\u73fe\u67d0\u500b\u5728 UNIX \u4e0a\u7528 C \u5beb\u7684\u7a0b\u5f0f\uff0c\u8dd1\u4e00\u9663\u5b50\u5f8c\u4f3c\u4e4e\u6703\u5403\u6389\u5f88\u591a\u786c\u789f\u7a7a\u9593\uff0c\u5403\u6389\u2026","rel":"","context":"\u5728\u300c\u4f5c\u696d\u7cfb\u7d71\u300d\u4e2d","block_context":{"text":"\u4f5c\u696d\u7cfb\u7d71","link":"https:\/\/dada.tw\/blog\/category\/comp\/os\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":15,"url":"https:\/\/dada.tw\/blog\/2006\/07\/25\/15\/","url_meta":{"origin":72,"position":5},"title":"\u4f7f\u7528 bcompiler \u4f86\u7de8\u8b6f\uff08\u52a0\u5bc6\uff09\u60a8\u7684 PHP \u539f\u59cb\u78bc","author":"dada","date":"2006-07-25","format":false,"excerpt":"Using bcomipler to compile (encode) your PHP scrip\u2026","rel":"","context":"\u5728\u300c\u7a0b\u5f0f\u8a9e\u8a00\u300d\u4e2d","block_context":{"text":"\u7a0b\u5f0f\u8a9e\u8a00","link":"https:\/\/dada.tw\/blog\/category\/comp\/language\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/dada.tw\/blog\/wp-json\/wp\/v2\/posts\/72","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dada.tw\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dada.tw\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dada.tw\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dada.tw\/blog\/wp-json\/wp\/v2\/comments?post=72"}],"version-history":[{"count":0,"href":"https:\/\/dada.tw\/blog\/wp-json\/wp\/v2\/posts\/72\/revisions"}],"wp:attachment":[{"href":"https:\/\/dada.tw\/blog\/wp-json\/wp\/v2\/media?parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dada.tw\/blog\/wp-json\/wp\/v2\/categories?post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dada.tw\/blog\/wp-json\/wp\/v2\/tags?post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}