kill SIGABRT não gera arquivo core do daemon iniciado a partir do crontab

2

Estou executando o CentOS 5.5 e trabalhando em aplicativos de servidor que, às vezes, preciso forçar o despejo principal para que eu possa ver o que está acontecendo. Se eu iniciar meu servidor a partir do shell e enviar o kill SIGABRT, um arquivo principal será criado. Se eu iniciar o mesmo programa a partir do crontab e depois eu enviar o mesmo sinal para ele, o servidor é "morto", mas nenhum arquivo principal é gerado. Alguém sabe por que isso e o que precisa ser adicionado ao meu código ou alterado nas configurações do sistema para permitir a geração de arquivos principais?

Apenas uma nota lateral
Eu tenho ulimit definido como ilimitado em / etc / profile

Eu configurei

  • kernel.core_uses_pid = 1
  • kernel.core_pattern = / var / cores /% h-% e-% p.core

no /etc/sysctl.conf

Além disso, meu aplicativo de servidor foi adicionado ao crontab sob o mesmo ID de login que estou executando do shell.

Qualquer ajuda muito apreciada

    
por Guma 22.02.2011 / 22:53

1 resposta

1

O diretório de trabalho atual para um trabalho cron pode ser diferente daquele que você espera. Tente fazer cd /some/writeable/dir && yourdaemon na sua entrada no crontab. Além disso, você deve normalmente executar deamons usando init ou Upstart ou similar. Veja Gerenciamento de processos .

De 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).)

    
por 22.02.2011 / 23:31

Tags