mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
coredump: optionally store coredumps on disk, not in the journal
Introduce a new configuration file /etc/systemd/coredump.conf to configure when to place coredumps in the journal and when on disk. Since the coredumps are quite large, default to storing them only on disk.
This commit is contained in:
@@ -3689,6 +3689,14 @@ systemd_coredump_LDADD = \
|
||||
rootlibexec_PROGRAMS += \
|
||||
systemd-coredump
|
||||
|
||||
dist_pkgsysconf_DATA += \
|
||||
src/journal/coredump.conf
|
||||
|
||||
if HAVE_ACL
|
||||
systemd_coredump_LDADD += \
|
||||
libsystemd-acl.la
|
||||
endif
|
||||
|
||||
systemd_coredumpctl_SOURCES = \
|
||||
src/journal/coredumpctl.c
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
14
src/journal/coredump.conf
Normal file
14
src/journal/coredump.conf
Normal file
@@ -0,0 +1,14 @@
|
||||
# This file is part of systemd.
|
||||
#
|
||||
# systemd is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation; either version 2.1 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# See coredump.conf(5) for details
|
||||
|
||||
[Coredump]
|
||||
#Storage=external
|
||||
#ProcessSizeMax=2G
|
||||
#ExternalSizeMax=2G
|
||||
#JournalSizeMax=767M
|
||||
@@ -205,7 +205,7 @@ void server_fix_perms(Server *s, JournalFile *f, uid_t uid) {
|
||||
log_warning("Failed to fix access mode on %s, ignoring: %s", f->path, strerror(-r));
|
||||
|
||||
#ifdef HAVE_ACL
|
||||
if (uid <= 0)
|
||||
if (uid <= SYSTEM_UID_MAX)
|
||||
return;
|
||||
|
||||
acl = acl_get_fd(f->fd);
|
||||
|
||||
@@ -26,3 +26,11 @@
|
||||
int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry);
|
||||
int calc_acl_mask_if_needed(acl_t *acl_p);
|
||||
int search_acl_groups(char*** dst, const char* path, bool* belong);
|
||||
|
||||
static inline void acl_freep(acl_t *acl) {
|
||||
|
||||
if (!*acl)
|
||||
return;
|
||||
|
||||
acl_free(*acl);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define USE(x, y) do{ (x) = (y); (y) = NULL; } while(0)
|
||||
|
||||
int parse_sleep_config(const char *verb, char ***_modes, char ***_states) {
|
||||
|
||||
_cleanup_strv_free_ char
|
||||
**suspend_mode = NULL, **suspend_state = NULL,
|
||||
**hibernate_mode = NULL, **hibernate_state = NULL,
|
||||
@@ -44,7 +45,8 @@ int parse_sleep_config(const char *verb, char ***_modes, char ***_states) {
|
||||
{ "Sleep", "HibernateState", config_parse_strv, 0, &hibernate_state },
|
||||
{ "Sleep", "HybridSleepMode", config_parse_strv, 0, &hybrid_mode },
|
||||
{ "Sleep", "HybridSleepState", config_parse_strv, 0, &hybrid_state },
|
||||
{}};
|
||||
{}
|
||||
};
|
||||
|
||||
int r;
|
||||
FILE _cleanup_fclose_ *f;
|
||||
|
||||
@@ -135,6 +135,7 @@ static int execute(char **modes, char **states) {
|
||||
}
|
||||
|
||||
static int help(void) {
|
||||
|
||||
printf("%s COMMAND\n\n"
|
||||
"Suspend the system, hibernate the system, or both.\n\n"
|
||||
"Commands:\n"
|
||||
|
||||
Reference in New Issue
Block a user