File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,16 @@ static void selinux_warning(struct libmnt_context *cxt, const char *tgt)
334
334
335
335
336
336
#ifdef USE_SYSTEMD
337
+ /*
338
+ * Note that this mount(8) message may generate thousands of lines of output
339
+ * when mount(8) is called from any script in systems with large fstab, etc.
340
+ *
341
+ * The goal is to avoid spamming system logs (don't print on stderr) and hide
342
+ * the hint if stderr is redirected/piped (in this case mount(8) is probably
343
+ * executed in a script).
344
+ *
345
+ * The target audience is users on a terminal who directly use mount(8).
346
+ */
337
347
static void systemd_hint (void )
338
348
{
339
349
static int fstab_check_done = 0 ;
@@ -342,6 +352,7 @@ static void systemd_hint(void)
342
352
struct stat a , b ;
343
353
344
354
if (isatty (STDERR_FILENO ) &&
355
+ isatty (STDOUT_FILENO ) &&
345
356
stat (_PATH_SD_UNITSLOAD , & a ) == 0 &&
346
357
stat (_PATH_MNTTAB , & b ) == 0 &&
347
358
cmp_stat_mtime (& a , & b , < ))
You can’t perform that action at this time.
0 commit comments