# ulimit setting persistance

## rickvernam

I am sure the question I have has been asked & answered somewhere on this forum, so I'll apologize now for not being able to find it (I did look)...

I need the ulimit -c option to be set to unlimited on a couple of my machines.

It seems that doing 

```
ulimit -c unlimited
```

is good only for the current session (I work on these machines strictly with ssh).  I figure there must be some way to make this a global, system wide setting.  Maybe in the kernel?  I am going to look there now, but figured I'd take advantage of the collective knowledge here...

Thanks

-Rick

----------

## HackingM2

You can place it in /etc/conf.d/local.start and it will be executed on every boot.  Possibly not the cleanest of solutions but it'll work.   :Wink: 

----------

## allucid

or put it in your shell's init file (.bashrc/.zshrc/etc.)

----------

## HackingM2

 *allucid wrote:*   

> or put it in your shell's init file (.bashrc/.zshrc/etc.)

 

Which would obviously be a much better solution.    :Very Happy: 

----------

## rickvernam

hmmm....  okay.

Now, if I start something that runs daemonized from a shell that has the ulimit -c set to unlimited and that shell is then closed, will the daemonized task conform to the ulimit value?

----------

## allucid

I would assume so since it was launched from the shell.

Setting the core limit from local.start won't work by the way. From the manpage:

```
       Since  ulimit  affects  the  current shell execution environment, it is

       always provided as a shell regular built-in. If it is called in a sepa-

       rate utility execution environment, such as one of the following:

              nohup ulimit -f 10000

              env ulimit 10000

       it does not affect the file size limit of the caller's environment.

```

----------

## HackingM2

Interesting.  I never knew that.  Guess I should have perused the man pages first.   :Wink: 

If it only works for the current shell then placing the line in the .bashrc/.zshrc/etc is the only solution AFAIK.

----------

## rickvernam

well, I set ulimit -c unlimited, then started the daemonized process.  it died on me & left no core file.

so, any other ideas to get core dump file size set to unlimited such that it affects daemonized processes?

Thanks

-Rick

----------

## allucid

What daemonized process is it? is it started by the init scripts? Can you run it non-daemonized?

----------

## rickvernam

real-time replicator for PostgreSQL - pgreplicate from PGCluster.

I have two installations of it: one is 'testing', the other is 'dev'.  The dev I usually run non-daemon.

The testing I cannot - and it is the one I really want the core dumps from b/c it occasionally pukes for reasons unknown to me, and I really want to figure out why...

I start it from command line - no init scripts or anything fancy like that.

Thanks

-Rick

----------

## RichieB

and there you go  :Smile: 

----------

## rickvernam

 *RichieB wrote:*   

> /etc/security/limits.conf
> 
> and there you go 

 

I knew there would be something easy and straight forward like that...

Thanks !  :Razz: 

-Rick

----------

