Core dumps are instantly removed

2019-12-18 Thread Dmitry Katsubo
Dear Debian users,

Hopefully you can easily help me with my confusion.

I would like to collect / keep core dumps in the system. For that I use 
systemd-coredump package which is configured as following:

=== cut /etc/systemd/coredump.conf ===
[Coredump]
Storage=external
MaxUse=5G
=== cut ===

Then I have created a script to send core dump report daily to root:

=== cut /etc/cron.daily/coredump ===
YESTERDAY=`date --date="1 day ago" +%Y-%m-%d`
MESSAGE=`coredumpctl list --no-pager -r -S $YESTERDAY -U $(date +%Y-%m-%d) 2> 
/dev/null` && (echo "$MESSAGE"; echo -e "\nLast core dump info:\n"; coredumpctl 
info --no-pager; echo -e "\nCore
dumps:\n"; ls -l /var/lib/systemd/coredump; ) | mail -s "Core dumps created 
yesterday $YESTERDAY" root
=== cut ===

What I get is:

=== cut ===
TIMEPID   UID   GID SIG COREFILE  EXE
Tue 2019-12-10 11:27:26 CET2537  1003   100   5 missing   
/usr/bin/light-locker

Last core dump info:

   PID: 2537 (light-locker)
...
Signal: 5 (TRAP)
 Timestamp: Tue 2019-12-10 11:27:25 CET (20h ago)
  Command Line: light-locker
Executable: /usr/bin/light-locker
...
   Storage: 
/var/lib/systemd/coredump/core.light-locker.1003.810304...157597364500.lz4 
(inaccessible)
   Message: Process 2537 (light-locker) of user 1003 dumped core.

Stack trace of thread 2537:
#0  0x7fde22515c75 n/a (libglib-2.0.so.0)
#1  0x7fde22516d0d g_log_default_handler (libglib-2.0.so.0)
#2  0x7fde22516f5f g_logv (libglib-2.0.so.0)
#3  0x7fde2251714f g_log (libglib-2.0.so.0)
#4  0x563b0e2f30a3 n/a (light-locker)
#5  0x7fde22615107 g_type_create_instance 
(libgobject-2.0.so.0)
...
Core dumps:

total 0
=== cut ===

As one can see, stack trace is somehow captured by coredumpctl (where it gets 
it from?) but core file is not there. I would like core dump files to be 
preserved for (say) 10 days.

light-locker generates really tiny core dump when I start it from console:

=== cut ===
$ /usr/bin/light-locker
Trace/breakpoint trap (core dumped)

# ls -l /var/lib/systemd/coredump/
-rw-r-+ 1 root root 884992 Dec 13 14:16 
core.light-locker.1003.8103...157624301300.lz4
=== cut ===

Also I am aware about this setting:

=== cut /usr/lib/tmpfiles.d/systemd.conf ===
d /var/lib/systemd/coredump 0755 root root 3d
=== cut ===

but it configures the directory to be cleaned in three days while they are 
removed sooner.

Any ideas? Thanks in advance!

P.S. I have read:

https://wiki.debian.org/HowToGetABacktrace#Core_dump
https://wiki.archlinux.org/index.php/Core_dump

but didn't find the answer.

-- 
With best regards,
Dmitry



Core dumps are instantly removed

2019-12-17 Thread Dmitry Katsubo
Dear Debian users,

Hopefully you can easily help me with my confusion.

I would like to collect / keep core dumps in the system. For that I use 
systemd-coredump package which is configured as following:

=== cut /etc/systemd/coredump.conf ===
[Coredump]
Storage=external
MaxUse=5G
=== cut ===

Then I have created a script to send core dump report daily to root:

=== cut /etc/cron.daily/coredump ===
YESTERDAY=`date --date="1 day ago" +%Y-%m-%d`
MESSAGE=`coredumpctl list --no-pager -r -S $YESTERDAY -U $(date +%Y-%m-%d) 2> 
/dev/null` && (echo "$MESSAGE"; echo -e "\nLast core dump info:\n"; coredumpctl 
info --no-pager; echo -e "\nCore
dumps:\n"; ls -l /var/lib/systemd/coredump; ) | mail -s "Core dumps created 
yesterday $YESTERDAY" root
=== cut ===

What I get is:

=== cut ===
TIMEPID   UID   GID SIG COREFILE  EXE
Tue 2019-12-10 11:27:26 CET2537  1003   100   5 missing   
/usr/bin/light-locker

Last core dump info:

   PID: 2537 (light-locker)
...
Signal: 5 (TRAP)
 Timestamp: Tue 2019-12-10 11:27:25 CET (20h ago)
  Command Line: light-locker
Executable: /usr/bin/light-locker
...
   Storage: 
/var/lib/systemd/coredump/core.light-locker.1003.810304...157597364500.lz4 
(inaccessible)
   Message: Process 2537 (light-locker) of user 1003 dumped core.

Stack trace of thread 2537:
#0  0x7fde22515c75 n/a (libglib-2.0.so.0)
#1  0x7fde22516d0d g_log_default_handler (libglib-2.0.so.0)
#2  0x7fde22516f5f g_logv (libglib-2.0.so.0)
#3  0x7fde2251714f g_log (libglib-2.0.so.0)
#4  0x563b0e2f30a3 n/a (light-locker)
#5  0x7fde22615107 g_type_create_instance 
(libgobject-2.0.so.0)
...
Core dumps:

total 0
=== cut ===

As one can see, stack trace is somehow captured by coredumpctl (where it gets 
it from?) but core file is not there. I would like core dump files to be 
preserved for (say) 10 days.

light-locker generates really tiny core dump when I start it from console:

=== cut ===
$ /usr/bin/light-locker
Trace/breakpoint trap (core dumped)

# ls -l /var/lib/systemd/coredump/
-rw-r-+ 1 root root 884992 Dec 13 14:16 
core.light-locker.1003.8103...157624301300.lz4
=== cut ===

Also I am aware about this setting:

=== cut /usr/lib/tmpfiles.d/systemd.conf ===
d /var/lib/systemd/coredump 0755 root root 3d
=== cut ===

but it configures the directory to be cleaned in three days while they are 
removed sooner.

Any ideas? Thanks in advance!

P.S. I have read:

https://wiki.debian.org/HowToGetABacktrace#Core_dump
https://wiki.archlinux.org/index.php/Core_dump

but didn't find the answer.

-- 
With best regards,
Dmitry