All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] e2scrub_all: only run in service mode when periodic_e2scrub=1
@ 2019-07-11 23:43 Theodore Ts'o
  0 siblings, 0 replies; only message in thread
From: Theodore Ts'o @ 2019-07-11 23:43 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: Theodore Ts'o

By default, e2scrub_all will not actually trigger online scrubs unless
periodic_e2scrub=1 is set in /etc/e2scrub.conf.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 scrub/e2scrub.conf.in | 4 ++++
 scrub/e2scrub_all.in  | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/scrub/e2scrub.conf.in b/scrub/e2scrub.conf.in
index 5c030877..661fc13f 100644
--- a/scrub/e2scrub.conf.in
+++ b/scrub/e2scrub.conf.in
@@ -1,5 +1,9 @@
 # e2scrub configuration file
 
+# Uncomment to enable automatic periodic runs of e2scrub_all
+# (either via cron or via a systemd timer)
+# periodic_e2scrub=1
+
 # e-mail destination used by e2scrub_fail when problems are found with
 # the file system.
 # recipient=root
diff --git a/scrub/e2scrub_all.in b/scrub/e2scrub_all.in
index f342faf2..5bdbd116 100644
--- a/scrub/e2scrub_all.in
+++ b/scrub/e2scrub_all.in
@@ -25,6 +25,7 @@ if (( $EUID != 0 )); then
     exit 1
 fi
 
+periodic_e2scrub=0
 scrub_all=0
 snap_size_mb=256
 reap=0
@@ -79,6 +80,11 @@ while getopts "nrAV" opt; do
 done
 shift "$((OPTIND - 1))"
 
+if [ -n "${SERVICE_MODE}" -a "${reap}" -ne 1 -a "${periodic_e2scrub}" -ne 1 ]
+then
+    exitcode 0
+fi
+
 # If some prerequisite packages are not installed, exit with a code
 # indicating success to avoid spamming the sysadmin with fail messages
 # when e2scrub_all is run out of cron or a systemd timer.
-- 
2.22.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-11 23:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-11 23:43 [PATCH] e2scrub_all: only run in service mode when periodic_e2scrub=1 Theodore Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.