SunOs 5.9: why is 'ulimit -c' not working?


 
Thread Tools Search this Thread
Operating Systems Solaris SunOs 5.9: why is 'ulimit -c' not working?
# 1  
Old 01-16-2012
SunOs 5.9: why is 'ulimit -c' not working?

I have a situation where the system is dumping a 2g causing filesystem to fill up. We identified the source and working on a solution. However, I wanted to limit the size of the 'core' file.

Please examine the test scenario ...

cnewtonne@mars> ulimit -f 0
cnewtonne@mars> ls -ltr core*
core*: No such file or directory
cnewtonne@mars> gcore $$
File Size Limit Exceeded(coredump)
cnewtonne@mars>
----------------------------------------
cnewtonne@mars> ulimit -c 0
cnewtonne@mars> ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) unlimited
stack(kbytes) 8192
coredump(blocks) 0
nofiles(descriptors) 256
vmemory(kbytes) unlimited

cnewtonne@mars> gcore $$
gcore: core.19697 dumped
cnewtonne@mars>

1) As you can see above, '-f' worked to prevent the creation of the file, whereas, '-c' did not. Why?
2) I ended up setting '-f' and '-c' to same value, however, the system still core-dumped few hours later with the same 2g file. Again, why?

Thank you.
# 2  
Old 01-16-2012
Can you post the output of
Code:
which ulimit

Which shell are you using? ulimit is provided by the shell and there's another external program by the same name in /usr/bin

Have you tried checking the return value of "ulimit -c 0"?
# 3  
Old 01-16-2012
Quote:
Originally Posted by cnewtonne
1) As you can see above, '-f' worked to prevent the creation of the file, whereas, '-c' did not. Why?
This is by design.

From gcore manual page:
NOTES
gcore is unaffected by the setrlimit(2) system call using the RLIMIT_CORE value.
Quote:
2) I ended up setting '-f' and '-c' to same value, however, the system still core-dumped few hours later with the same 2g file. Again, why?
Is ulimit called in one of the problem process parents ?
What says
Code:
plimit <pid>

with pid being the target process id ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

--SunOS 5.10 nawk for paragraph not working

The machine is using bash: ================== bash -version GNU bash, version 3.2.51(1)-release (i386-pc-solaris2.10) Copyright (C) 2007 Free Software Foundation, Inc. ========================= I have the following xml file. am trying to get a whole paragraph if it meets certain criteria.... (9 Replies)
Discussion started by: gilgamesh
9 Replies

2. Solaris

Sendmail not working in SUNOS

Hi All i am trying to send a mail from SunOS to my outlook mail but it is not working neither giving any error please suggest # uuencode /tmp/t.txt t.txt | mailx -s test v.com # # uname -a SunOS 5.9 Generic_122300-25 sun4u sparc SUNW,Sun-Fire-V440 (3 Replies)
Discussion started by: scriptor
3 Replies

3. UNIX for Advanced & Expert Users

Manipulate files with find and fuser not working as expected on SunOs

Greetings, For housekeeping, I use the following command: find /some/path -type f -name "*log*" ! -exec fuser -s "{}" 2>/dev/null \; -exec ls -lh {} \; It finds all log files not currently in use by a process and manipulates them. This command always works on linux and redhat machines,... (2 Replies)
Discussion started by: dampio
2 Replies

4. Shell Programming and Scripting

mailx not working on SunOS 5.9

I m trying to send o/p of one file using mailx command but is not working PFB command : cat healthchecklog | mailx -s "HEALTH CHECKS" abc@jkl.com also I have checked the ps -ef for mailx which is giveing below o/p ps -ef | grep mail root 364 1 0 Jun 08 ? ... (11 Replies)
Discussion started by: Jcpratap
11 Replies

5. Solaris

All i/o (ftp) not working on this SunOS 5.10

Hi everyone: I have been trying to simply FTP a file over to this SunOS 5.10 (which is same as Solaris 10 now) and nothing works! I can only Telnet to this via SSH (with my own account/uid), and I can also send simple mail out with mailx, that's all!!! I cannot FTP to it (I think FTP... (7 Replies)
Discussion started by: steve701
7 Replies

6. Solaris

ulimit

how do i check the ulimit set on my server.. ca i know whats the command ?? thanks in advance .. (5 Replies)
Discussion started by: expert
5 Replies

7. Shell Programming and Scripting

sudo + ulimit not working ?

When I use sudo with ulimit there is an error but if I use ulimit without sudo there is no error. In bash: user1@debian:~$ sudo -u user2 -H ulimit -S -c unlimited sudo: ulimit: command not found user1@debian:~$ user1@debian:/home/user1$ ulimit -S -c unlimited user1@debian:/home/user1$... (3 Replies)
Discussion started by: cyler
3 Replies

8. Solaris

tr -d is not working on SunOS 5.9

i am using sunos 5.9. entityname="india\/delhi" correctpattern="<branch value=\"/`echo $entityname | tr -d '\'`/WORKAREA/\"> echo $correctpattern the output should be <branch value="/india/delhi/WORKAREA/"> This is working fine in command line but not working when i placed these... (1 Reply)
Discussion started by: millan
1 Replies

9. UNIX for Dummies Questions & Answers

SunOS 5.10 - VI Arrow keys not working

Hi I am working on SunOS 5.10 from remote terminal using putty. Also echo $TERM xterm In vi editor when in insert mode arrow keys are not working for cursor movement instead they print A B C and D. Please help. thanks ravs (7 Replies)
Discussion started by: ravashingravi
7 Replies

10. UNIX for Advanced & Expert Users

Migration of binary file from Sunos 5.8 to Sunos 5.9

I have compiled binary file using "cc" on SunOS 5.8 and the same binary file i have copied to SunOS 5.9 and it is giving me core dump error.I want to know whether migration of compiled code from lower version to higer version created this problem. how can i solve this problem.I am pasting the core... (1 Reply)
Discussion started by: Arvind Maurya
1 Replies
Login or Register to Ask a Question