Enable core dumps

This commit is contained in:
Christopher Baines 2025-06-29 08:12:41 +02:00
parent aa3d98324d
commit cdf034cd9f

View file

@ -104,6 +104,22 @@
(%guix-data-service-metrics-registry registry)
(with-exception-handler
(lambda (exn)
(simple-format #t "failed enabling core dumps: ~A\n" exn))
(lambda ()
(setrlimit 'core #f #f))
#:unwind? #t)
(let ((core-file
(string-append (getcwd) "/core"))
(metric
(make-gauge-metric registry
"core_dump_file_last_modified_seconds")))
(when (file-exists? core-file)
(metric-set metric
(stat:mtime (stat core-file)))))
(with-exception-handler
(lambda (exn)
(simple-format #t "failed increasing open file limit: ~A\n" exn))