kill SIGABRT does not generate core file from daemon started from crontab

5,697

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:

There are various circumstances in which a core dump file is not pro‐ duced:

  • The process does not have permission to write the core file. (By default the core file is called core, and is created in the current working directory. See below for details on naming.) Writing the core file will fail if the directory in which it is to be created is non-writable, or if a file with the same name exists and is not writable or is not a regular file (e.g., it is a directory or a sym‐ bolic link).

  • A (writable, regular) file with the same name as would be used for the core dump already exists, but there is more than one hard link to that file.

  • The file system where the core dump file would be created is full; or has run out of inodes; or is mounted read-only; or the user has reached their quota for the file system.

  • The directory in which the core dump file is to be created does not exist.

  • The RLIMIT_CORE (core file size) or RLIMIT_FSIZE (file size) resource limits for the process are set to zero; see getrlimit(2) and the documentation of the shell's ulimit command (limit in csh(1)).

  • The binary being executed by the process does not have read permission enabled.

  • The process is executing a set-user-ID (set-group-ID) program that is owned by a user (group) other than the real user (group) ID of the process. (However, see the description of the prctl(2) PR_SET_DUMPABLE operation, and the description of the /proc/sys/fs/suid_dumpable file in proc(5).)

Share:
5,697

Related videos on Youtube

user9517
Author by

user9517

Updated on September 17, 2022

Comments

  • user9517
    user9517 almost 2 years

    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