summaryrefslogtreecommitdiffstats
path: root/src/core/mount.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/mount.c')
-rw-r--r--src/core/mount.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core/mount.c b/src/core/mount.c
index be46e56689..f16e5c487b 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -1909,6 +1909,7 @@ static void mount_enumerate(Manager *m) {
mnt_init_debug(0);
if (!m->mount_monitor) {
+ unsigned mount_rate_limit_burst = 5;
int fd;
m->mount_monitor = mnt_new_monitor();
@@ -1948,7 +1949,15 @@ static void mount_enumerate(Manager *m) {
goto fail;
}
- r = sd_event_source_set_ratelimit(m->mount_event_source, 1 * USEC_PER_SEC, 5);
+ /* Let users override the default (5 in 1s), as it stalls the boot sequence on busy systems. */
+ const char *e = secure_getenv("SYSTEMD_DEFAULT_MOUNT_RATE_LIMIT_BURST");
+ if (e) {
+ r = safe_atou(e, &mount_rate_limit_burst);
+ if (r < 0)
+ log_debug("Invalid value in $SYSTEMD_DEFAULT_MOUNT_RATE_LIMIT_BURST, ignoring: %s", e);
+ }
+
+ r = sd_event_source_set_ratelimit(m->mount_event_source, 1 * USEC_PER_SEC, mount_rate_limit_burst);
if (r < 0) {
log_error_errno(r, "Failed to enable rate limit for mount events: %m");
goto fail;