home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.admin:4848 comp.unix.questions:10659 comp.unix.shell:3784
- Newsgroups: comp.unix.admin,comp.unix.questions,comp.unix.shell
- Path: sparky!uunet!ftpbox!mothost!merlin.dev.cdx.mot.com!merlin.dev.cdx.mot.com!lezz
- From: lezz@merlin.dev.cdx.mot.com (Lezz Giles)
- Subject: Re: How to prevent a large core-dump
- Message-ID: <1992Sep2.175259.15393@merlin.dev.cdx.mot.com>
- Sender: news@merlin.dev.cdx.mot.com (USENET News System)
- Nntp-Posting-Host: fenric.dev.cdx.mot.com
- Reply-To: lezz@merlin.dev.cdx.mot.com (Lezz Giles)
- Organization: Motorola Codex, Canton, MA
- References: <1992Aug25.173056.13401@utwente.nl> <1992Sep2.94728.26099@ms.uky.edu>
- Distribution: na
- Date: Wed, 2 Sep 1992 17:52:59 GMT
- Lines: 26
-
- In article <1992Sep2.94728.26099@ms.uky.edu>, kherron@ms.uky.edu (Kenneth Herron) writes:
- |>msb@sq.sq.com (Mark Brader) writes:
- |>
- |>>> echo > core
- |>>> chmod 0 core
- |>>> Then the program will not produce a core, since the file "core" already
- |>>> exists, but is unwritable (see signal(2)).
- |>
- |>>Fine for most purposes, probably including the original query, but wait
- |>>until the day that it's a setuid-root program whose core dumps you want
- |>>to prevent!
- |>> mkdir core
-
- I can't believe that nobody else has mentioned another solution yet....
-
- ln -s /dev/null core
-
- This won't work on all unixes since not everybody has symbolic links,
- but it has the advantage that it works for setuid-root programs and it
- will be reasonably obvious in the future to a unix-literate person
- why the 'core' file was created.
-
- BTW, I can't take credit for this solution - it is simply what we have
- at our site and was thought up by some genius in the support dept.
-
- lezz "The new infinite write-only memory device - /dev/null" Giles
-