I am running CentOS 5.5 and working on server application that sometimes I need to force core dump so I can see what is going on. If I start my server from shell and send kill SIGABRT, a core file is created. If I start same program from crontab and then I send the same signal to it the server is "killed" but no core file is generated. Does any one know why is that and what need to be added to my code or changed in system settings to allow core file generation?
Just a side note
I have ulimit set to unlimited in /etc/profile
I have set
- kernel.core_uses_pid = 1
- kernel.core_pattern=/var/cores/%h-%e-%p.core
in /etc/sysctl.conf
Also my server app was added to crontab under same login id as I am running it from shell.
Any help greatly appreciated
Best Answer
The current working directory for a cron job may be different than the one you expect. Try doing
cd /some/writeable/dir && yourdaemon
in your crontab entry. Also, you should normally run deamons using init or Upstart or similar. See Process Management.From
man 5 core
: